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

Building lit-virtualizer fails #264

Closed
trading-peter opened this issue Jul 16, 2020 · 1 comment
Closed

Building lit-virtualizer fails #264

trading-peter opened this issue Jul 16, 2020 · 1 comment

Comments

@trading-peter
Copy link

trading-peter commented Jul 16, 2020

Hi,

I'm unable to build my project that uses lit-virtualizer. First up I created a minimal example repo to demonstrate this problem. It has a readme with the steps to reproduce the following errors. https://github.com/trading-peter/esbuild_edge

On the first run of the build script it errors out with this:

Error: Build failed with 3 errors:
error: Cannot traverse from chunk "../node_modules/lit-virtualizer/lib/uni-virtualizer/lib/layouts/Layout1d.js" to chunk "chunk.m6OIDGXX.js"
error: Refusing to overwrite input file: node_modules/lit-virtualizer/lib/uni-virtualizer/lib/layouts/Layout1d.js
error: Refusing to overwrite input file: node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
    at failureErrorWithLog (/home/pk/Dokumente/esbuild_edge/litvirtualizer/node_modules/esbuild/lib/main.js:407:15)
    at /home/pk/Dokumente/esbuild_edge/litvirtualizer/node_modules/esbuild/lib/main.js:373:29
    at handleIncomingPacket (/home/pk/Dokumente/esbuild_edge/litvirtualizer/node_modules/esbuild/lib/main.js:357:9)
    at Socket.readFromStdout (/home/pk/Dokumente/esbuild_edge/litvirtualizer/node_modules/esbuild/lib/main.js:305:7)
    at Socket.emit (events.js:315:20)
    at Socket.EventEmitter.emit (domain.js:505:15)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

and after that if running the script again with this error:

Error: Build failed with 1 error:
node_modules/lit-virtualizer/lib/uni-virtualizer/lib/layouts/Layout1d.js:1:14: error: Could not resolve ""
    at failureErrorWithLog (/home/pk/Dokumente/esbuild_edge/litvirtualizer/node_modules/esbuild/lib/main.js:407:15)
    at /home/pk/Dokumente/esbuild_edge/litvirtualizer/node_modules/esbuild/lib/main.js:373:29
    at handleIncomingPacket (/home/pk/Dokumente/esbuild_edge/litvirtualizer/node_modules/esbuild/lib/main.js:357:9)
    at Socket.readFromStdout (/home/pk/Dokumente/esbuild_edge/litvirtualizer/node_modules/esbuild/lib/main.js:305:7)
    at Socket.emit (events.js:315:20)
    at Socket.EventEmitter.emit (domain.js:505:15)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

The build script in the uses gulp and looks like this:

const gulp = require('gulp');

const esBuildClient = async () => {
  const { build } = require('esbuild');

  return build({
    entryPoints: [
      'entrypoints/entry1.js',
      'entrypoints/entry2.js',
    ],
    outdir: 'dist',
    minify: true,
    bundle: true,
    sourcemap: true,
    splitting: true,
    format: 'esm'
  })
};

gulp.task('esbuild', async () => {
  await esBuildClient()
});

In my real app I need the splitting option, that's why its also set in the example. Could ofc also be that I'm doing something wrong 😄

@chowey
Copy link

chowey commented Jul 18, 2020

I got a similar error error: Cannot traverse from chunk ....

I had a dynamic import that was shared between two entry points, although I haven't been able to reproduce it in a small example yet. I do know that when I removed the dynamic import, the error went away.

@evanw evanw closed this as completed in 578f895 Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants