-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fail to compile
when a package name is customised
#90
Comments
Hello there 👋 I did not think about this case but I am not suprised at all. Webpack (the Next.js bundler) does not really know the exact path of a specified package (we work with regexes in order to detect if we should transpile a package or not). There is probably a couple of things we could do about it. In the meantime, I highly recommend to use the same name than the pathname (I don't really see a valid usecase when you would like to do that) |
Oh, I see. Just wondering in the doc
How do you prepend the namespace to the folder name? As there is a As usecase, it's a common practice to have namespace in monorepo to avoid external package naming collision. It is also easier to identify which dependencies are internal base on the However, it turns out the lib I need requires ts config with So please feel free to close the issue if you found it not relevant anymore. Thanks for asking my questions =] |
Should be fixed in #132 |
Are you trying to transpile a local package or an npm package?
Local package
Describe the bug
When I customize a package name, i.e. name in
package.json
is different from the package folder name, it fails with error message :To Reproduce
Reproduction repo here
Home page (without requiring name-customised package) is working
The page requires name-customised package is failing
When comparing the working and failing pages, apparently the error drivers are from
https://github.com/ivawzh/reproduce-next-transpile-modules-error/blob/0e8af7e8696f858875f39ecc5c6aa613fb9cdcea/packages/web-app/next.config.js#L5
https://github.com/ivawzh/reproduce-next-transpile-modules-error/blob/0e8af7e8696f858875f39ecc5c6aa613fb9cdcea/packages/db/package.json#L2
Expected behavior
I believe (correct me if I am wrong) the correct behaviour is that it doesn't restrict package name to match folder's name, especially when the name is following the yarn workspace's common pattern. If that's not the case, would you please also let me know what kind of implementation the doc was referring to 👇 ?
Thanks in advanced 🙂
Setup
next-transpile-modules
version: 3.3.0npm
/yarn
version: yarn v1.22.4The text was updated successfully, but these errors were encountered: