Skip to content
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

Package path ./lib/languages is not exported from package - breaks import with webpackChunkName #3376

Closed
azul opened this issue Oct 27, 2021 · 1 comment
Labels
bug help welcome Could use help from community parser

Comments

@azul
Copy link

azul commented Oct 27, 2021

Describe the issue/behavior that seems buggy

Trying to upgrade nextcloud/text from version 10 to 11 results in

ERROR in ./src/EditorFactory.js 81:19-83:57
Module not found: Error: Package path ./lib/languages is not exported from package /home/runner/work/text/text/node_modules/highlight.js (see exports field in /home/runner/work/text/text/node_modules/highlight.js/package.json)
 @ ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorWrapper.vue?vue&type=script&lang=js&
 @ ./src/components/EditorWrapper.vue?vue&type=script&lang=js& 1:0-173 1:189-192 1:194-364 1:194-364
 @ ./src/components/EditorWrapper.vue 2:0-65 3:0-60 3:0-60 11:2-8
 @ ./src/public.js

Sample Code or Instructions to Reproduce

The code in question is trying to dynamically load languages with webpack:

const lang = await import(/* webpackChunkName: "highlight/[request]" */'highlight.js/lib/languages/' + languages[i])

I can reproduce this locally by checking out the dependabot/npm_and_yarn/highlight.js-11.3.1 branch and running

npm ci
npm run build

Expected behavior
The build should succeed.

Additional context
If i remove the exports section from node_modules/highlight.js/package.json the build succeeds.

@azul azul added bug help welcome Could use help from community parser labels Oct 27, 2021
@azul
Copy link
Author

azul commented Oct 27, 2021

Looks like #3223, sorry for the noise.

@azul azul closed this as completed Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community parser
Projects
None yet
Development

No branches or pull requests

1 participant