vite-plugin-comlink icon indicating copy to clipboard operation
vite-plugin-comlink copied to clipboard

Unexpected early exit with import.meta.url

Open arjunindia opened this issue 2 years ago • 6 comments

Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:
(vite:worker-import-meta-url) transform "F:/htmlcss/ppms-web-test/src/utils.ts"
error during build:
Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:
(vite:worker-import-meta-url) transform "F:/htmlcss/ppms-web-test/src/utils.ts"
    at EventEmitter.handleEmptyEventLoop (file:///F:/htmlcss/ppms-web-test/node_modules/rollup/dist/es/shared/node-entry.js:24753:20)
    at Object.onceWrapper (node:events:627:28)
    at EventEmitter.emit (node:events:525:35)
    at process.<anonymous> (file:///F:/htmlcss/ppms-web-test/node_modules/rollup/dist/es/shared/node-entry.js:24747:55)
    at process.emit (node:events:525:35)
    at process._0x5638e9 [as emit] (C:\Users\user\.vscode\extensions\wallabyjs.console-ninja-0.0.105\out\buildHook\index.js:1:239521)

arjunindia avatar Apr 05 '23 16:04 arjunindia

Please provide a full reproduction example!

mathe42 avatar Apr 06 '23 19:04 mathe42

I get this too when building for production. Vite Config: import { resolve } from 'path'; import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react-swc'; import { name, version } from './package.json'; import dts from 'vite-plugin-dts'; import tsConfigPaths from 'vite-tsconfig-paths'; import svgr from 'vite-plugin-svgr'; import { visualizer } from 'rollup-plugin-visualizer'; import { externalizeDeps } from 'vite-plugin-externalize-deps'; import { comlink } from 'vite-plugin-comlink';

export default defineConfig({ build: { lib: { entry: resolve('src', 'index.ts'), name: 'testLib', formats: ['es'], fileName: (format) => index.${format}.js, }, }, define: { pkgJson: { name, version, }, }, worker: { plugins: [comlink()], }, plugins: [comlink(), react(), svgr(), tsConfigPaths(), dts(), visualizer(), externalizeDeps()], });

packages: "react": "^17.0.2", "react-dom": "^17.0.2", "vite": "^4.0.0", "vite-plugin-comlink": "^3.0.5",

dkspec avatar Apr 06 '23 22:04 dkspec

Please provide a full reproduction example! (for example a reposetory on github)

mathe42 avatar Apr 07 '23 05:04 mathe42

https://github.com/arjunindia/vitejs-vite-ppmhcb

(I didn't use this plugin here, just comlink I made this to raise an issue on the vite repo)

arjunindia avatar Apr 07 '23 10:04 arjunindia

It seems like a problem with vite itself

The problem seems to be dependency looping - like utils.ts -> workers.ts -> utils.ts -> ...

arjunindia avatar Apr 07 '23 10:04 arjunindia

https://github.com/vitejs/vite/issues/7015

arjunindia avatar Apr 07 '23 12:04 arjunindia