-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module resolution errors #161
Comments
Do the files in |
Can the layout of the monorepo be an issue?
|
Does your tree structure mean there are no files at all in it? It looks for a file |
That's fine. I use monorepos all the time, so that shouldn't be a problem. So the file exists but your build tool complains it does not exist. This is unfortunately not related to deepkit as the only thing we need to make sure is that the files are available and they correctly import each other. Anything else is up to the build tool. Does |
Nx calls nextjs build tool If I understood your question correctly
|
Ok, that code looks fine. So, it seems you installed all the packages correctly and the files are correct. At this point, I can't help further as I have no idea how next builds the stuff and how to debug that error using it. I'd probably try to modify the file |
Thanks. On a side note, I see this project is using Lerna. I've seen Lerna isn't actively maintained anymore. |
Yeah, was thinking about using Rush from Microsoft, but nothing concretely planned. Lerna works well for the moment still. :) |
I posted the issue at vercel/next.js#31974 TL;DR: Fails with NextJS 12.x. Works with NextJS 11.x |
Could you have a look at "when available. node_modules are directly loaded by Node.js and not bundled, so the Node.js ESM guidelines apply." |
TypeScript's compiler does not support Node's default ESM resolution algorithm. They have introduced it in version 4.5 beta https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#esm-nodejs, but dropped it in the final 4.5 due to issues. To enable the commonly used module resolution algorithm you have to pass to node |
I think it would help to add the |
We added already a lot of .js file extension in our imports, not all are covered yet though |
if that means it will work with nuxt 3 as well ? |
@productdevbook If nuxt / next uses ESM and the file extensions were the only problem, then yes, but I don't know if there are other problems, we will see once the PR is merged and a new release is released |
I have a NextJs app inside a monorepo. Pacakges are built using Nx
package.json
Yarn install log
I try to build
I get
Looking at the yarn log, I then see that It's messing a peer dependency to
"@deepkit/core@^1.0.1-alpha.13"
"reflect-metadata": "^0.1.13"
So I added those.
Then the build error becomes
The text was updated successfully, but these errors were encountered: