Closed eagerestwolf closed 4 months ago
same problem using path aliases
It fails with webpack, too.
The package is misconfigured. Please contact the authors of @skeletonlabs/skeleton
instead.
./app/globals.css.webpack[javascript/auto]!=!./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[12].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[12].oneOf[10].use[3]!./app/globals.css
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './plugin' is not defined by "exports" in /Users/kdy1/projects/repro-next-66887/node_modules/@skeletonlabs/skeleton/package.json
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/eagerestwolf/nextjs-turbopack-import-bug
To Reproduce
create-next-app@rc
, enabling Turbopack@skeletonlabs/skeleton@next
Current vs. Expected behavior
I would expect that Turbopack would be able to resolve the path to the Skeleton plugin; however, it seems to be ignoring the
exports
in thepackage.json
for Skeleton. The exact error is included below:Provide environment information
Which area(s) are affected? (Select all that apply)
Module Resolution, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I tested the affected code with
create-turbo@canary
to create a reproduction for that repository, but the bug doesn't seem to appear in a standard turbo app (for reference, I tried thewith-tailwind
example, and it worked fine). I have also tried Bun, PNPM, and NPM suspecting a package manager issue (those have happened in the past), but still the issue persisted. Simply removing the--turbo
flag from thenext dev
command causes everything to work as expected (you're free to try that yourself). I'm not sure what exactly is going on, but it seems that somewhere in thenext dev
pipeline, Turbo starts ignoring theexports
field in somepackage.json
files.