-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Failure to resolve modules from yarn workspaces when module has rootDir/outDir #13197
Comments
TLDR;Use
The full rambling storySince this was considered a good first issue I figured I might be able to figure it out The only way I found to dump the actual effective webpack config and stat output was to plug I was able to make the project compile by changing the webpack config but it opens almost more questions than it solves. Resolving the However So the imports of The reproduction repository master has been updated accordingly at jeantil/next-9-ts-aliases-workspaces@ad0b342 Oh my tsxInterestingly, the Adding I thought for a moment the
to the webpack config. The
Dumping all the paths handled by the exclude rule on My next best guess was that there is some kind of config in babel loader that knows how to handle I tried a custom
Since I wasn't sure the config was being applied I also checked the next babel preset and added both options right in there but that still failed. That's as far as I was able to go, I guess i'll let the [1] I'm not sure why the documentation recommends |
|
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader. An even nicer DX would auto detect the presence of a `paths` section in the typescript config and automatically include `tsconfig-paths-webpack-plugin`
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
Typescript configuration can inherit from files above cwd in the filesystem. If a baseUrl was declared in such a file, it would not be picked up by the webpack config. This would force users to use the next-transpile-module and duplicate configuration with unintuitive path relations (see vercel#13197 for a detailed analysis) If baseUrl is resolved it should be used instead of dir as the root include for babel-resolve-loader.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
In a yarn workspace based monorepo (derived from examples/with-yarn-workspace), with a typescript module which uses rootDir and outDir settings in tsconfig.json and path aliases in the shared tsconfig.json config.
Next fails to resolve the module even though the tsc build works fine.
To Reproduce
clone the reproduction repository
checkout
2c7f4bd
check that typescript builds correctly
yarn workspace web-app tsc -b -v
run
yarn dev
the build fails to resolve the
baz
moduleExpected behavior
the build completes and the index page displays all three strings foo bar baz
System information
Additional context
Trying to apply next-transpile-modules to baz didn't help either.
This does not use project references, only path aliases.
Removing the
main
entry in thebaz
module'spackage.json
doesn't change the issueThe text was updated successfully, but these errors were encountered: