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

Error: [vite]: Rollup failed to resolve import "@hls-downloader/core/lib/store" #330

Closed
0xdevalias opened this issue Apr 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@0xdevalias
Copy link

Describe the bug

With tag v4.0.1 checked out, running ./scripts/build.sh gets the following error:

..snip..

> @hls-downloader/background@4.0.1 build
> vite build

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
vite v5.1.7 building for production...
✓ 1 modules transformed.
x Build failed in 32ms
error during build:) ⠼ reify:unist-util-visit-parents: http fetch GET 200 https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1
Error: [vite]: Rollup failed to resolve import "@hls-downloader/core/lib/store" from "/Users/devalias/dev/hls-downloader/src/background/src/index.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at viteWarn (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:67195:27)
    at onRollupWarning (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:67223:9)
    at onwarn (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:66927:13)
    at file:///Users/devalias/dev/hls-downloader/src/background/node_modules/rollup/dist/es/shared/node-entry.js:17398:13
    at Object.logger [as onLog] (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/rollup/dist/es/shared/node-entry.js:19056:9)
    at ModuleLoader.handleInvalidResolvedId (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/rollup/dist/es/shared/node-entry.js:18002:26)
    at file:///Users/devalias/dev/hls-downloader/src/background/node_modules/rollup/dist/es/shared/node-entry.js:17960:26

..snip..

To Reproduce
Steps to reproduce the behavior:

  1. git fetch
  2. git checkout v4.0.1
  3. ./scripts/build.sh
  4. See error

Expected behavior
Everything would build properly.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS Sonoma 14.4.1 (23E224)
  • Browser: N/A
  • Node Version: v20.2.0

Additional context
N/A

@0xdevalias 0xdevalias added the bug Something isn't working label Apr 16, 2024
@0xdevalias
Copy link
Author

Apparently it can be triggered more specifically with ./scripts/build-background.sh:

⇒ scripts/build-background.sh

up to date, audited 54 packages in 617ms

6 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> @hls-downloader/background@4.0.1 build
> vite build

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
vite v5.1.7 building for production...
✓ 1 modules transformed.
x Build failed in 33ms
error during build:
Error: [vite]: Rollup failed to resolve import "@hls-downloader/core/lib/store" from "/Users/devalias/dev/hls-downloader/src/background/src/index.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at viteWarn (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:67195:27)
    at onRollupWarning (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:67223:9)
    at onwarn (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:66927:13)
    at file:///Users/devalias/dev/hls-downloader/src/background/node_modules/rollup/dist/es/shared/node-entry.js:17398:13
    at Object.logger [as onLog] (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/rollup/dist/es/shared/node-entry.js:19056:9)
    at ModuleLoader.handleInvalidResolvedId (file:///Users/devalias/dev/hls-downloader/src/background/node_modules/rollup/dist/es/shared/node-entry.js:18002:26)
    at file:///Users/devalias/dev/hls-downloader/src/background/node_modules/rollup/dist/es/shared/node-entry.js:17960:26

@puemos
Copy link
Owner

puemos commented Apr 16, 2024

Thanks! it's been fixed

@puemos puemos closed this as completed Apr 16, 2024
@0xdevalias
Copy link
Author

Commit for future reference: 5c415bc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants