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

Regression on vite 4.3 build when resolving packages #12888

Closed
7 tasks done
smeng9 opened this issue Apr 18, 2023 · 2 comments · Fixed by #12903
Closed
7 tasks done

Regression on vite 4.3 build when resolving packages #12888

smeng9 opened this issue Apr 18, 2023 · 2 comments · Fixed by #12903
Labels
regression The issue only appears after a new release

Comments

@smeng9
Copy link
Contributor

smeng9 commented Apr 18, 2023

Describe the bug

I am updating from vite 4.2.1 to 4.3 beta and I expect my build command to work the same without problem. After trying different 4.3 beta versions, the issue seems to be introduced between 4.2.1 and 4.3.0-beta.0.

Reproduction

https://stackblitz.com/edit/vitejs-vite-ehaytj?file=package.json&terminal=dev

Steps to reproduce

  1. Download the reproduction
  2. Setup the package manager using $ yarn set version berry
  3. Run $ yarn build to build the release

System Info

System:
    OS: Linux 5.19 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
    Memory: 208.00 MB / 7.22 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.12.0 - /usr/bin/node
    Yarn: 3.5.0 - /usr/bin/yarn
    npm: 8.19.2 - /usr/bin/npm
  Browsers:
    Firefox: 111.0.1

Used Package Manager

yarn

Logs

transforming (958) .yarn/__virtual__/open-vector-editor-virtual-69cfb0ac1b/[plugin:vite:resolve] Module "string_decoder" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/__virtual__/bio-parsers-virtual-4a95e6c22e/0/cache/bio-parsers-npm-9.3.6-e8a2307998-0082495ed0.zip/node_modules/bio-parsers/lib/parsers/snapgeneToJson.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "string_decoder" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/__virtual__/bio-parsers-virtual-4a95e6c22e/0/cache/bio-parsers-npm-9.3.6-e8a2307998-0082495ed0.zip/node_modules/bio-parsers/lib/parsers/snapgeneToJson.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (1658) .yarn/__virtual__/@blueprintjs-core-virtual-401391ae3f/[plugin:vite:resolve] Module "path" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/vfile-npm-2.3.0-0781febdcc-59f1be789f.zip/node_modules/vfile/core.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "path" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/vfile-npm-2.3.0-0781febdcc-59f1be789f.zip/node_modules/vfile/core.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (1998) .yarn/cache/unist-util-stringify-position-npm-1.1.2-df0[plugin:vite:resolve] Module "path" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/replace-ext-npm-1.0.0-5d4ecb34ac-123e5c2804.zip/node_modules/replace-ext/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "path" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/replace-ext-npm-1.0.0-5d4ecb34ac-123e5c2804.zip/node_modules/replace-ext/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (2173) .yarn/cache/lodash-npm-4.17.21-6382451519-eb835a2e51.zi[plugin:vite:resolve] Module "string_decoder" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/@gmod-gff-npm-1.3.0-f29c3629ad-c5df33d182.zip/node_modules/@gmod/gff/esm/api.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "string_decoder" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/@gmod-gff-npm-1.3.0-f29c3629ad-c5df33d182.zip/node_modules/@gmod/gff/esm/api.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (2459) .yarn/cache/lodash-npm-4.17.21-6382451519-eb835a2e51.zi[plugin:vite:resolve] Module "events" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/stream-browserify-npm-3.0.0-4c0bd97245-4c47ef64d6.zip/node_modules/stream-browserify/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "events" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/stream-browserify-npm-3.0.0-4c0bd97245-4c47ef64d6.zip/node_modules/stream-browserify/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (2590) .yarn/unplugged/core-js-npm-2.6.12-0b93d77d31/node_modu[plugin:vite:resolve] Module "buffer" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/_stream_writable.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "buffer" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/_stream_writable.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (2672) .yarn/cache/lodash-es-npm-4.17.21-b45832dfce-05cbffad6e[plugin:vite:resolve] Module "events" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/_stream_readable.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "events" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/_stream_readable.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
[plugin:vite:resolve] Module "buffer" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/_stream_readable.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "buffer" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/_stream_readable.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (2709) .yarn/cache/lodash-es-npm-4.17.21-b45832dfce-05cbffad6e"buffer/" is imported by "buffer/?commonjs-external", but could not be resolved – treating it as an external dependency.
transforming (2805) .yarn/cache/lodash-npm-4.17.21-6382451519-eb835a2e51.zi[plugin:vite:resolve] Module "events" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/internal/streams/stream-browser.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "events" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/internal/streams/stream-browser.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (2882) .yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6[plugin:vite:resolve] Module "buffer" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/internal/streams/buffer_list.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module "buffer" has been externalized for browser compatibility, imported by "/home/motion/Developer/vite43/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip/node_modules/readable-stream/lib/internal/streams/buffer_list.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
transforming (3017) .yarn/cache/lodash-es-npm-4.17.21-b45832dfce-05cbffad6e"string_decoder/" is imported by "string_decoder/?commonjs-external", but could not be resolved – treating it as an external dependency.
transforming (3416) .yarn/cache/@juggle-resize-observer-npm-3.4.0-659544c6bUse of eval in ".yarn/cache/bluebird-npm-3.7.2-6a54136ee3-869417503c.zip/node_modules/bluebird/js/browser/bluebird.js" is strongly discouraged as it poses security risks and may cause issues with minification.
✓ 3416 modules transformed.
✓ built in 2m 59s
"StringDecoder" is not exported by "__vite-browser-external", imported by ".yarn/cache/@gmod-gff-npm-1.3.0-f29c3629ad-c5df33d182.zip/node_modules/@gmod/gff/esm/api.js".
file: /home/motion/Developer/vite43/.yarn/cache/@gmod-gff-npm-1.3.0-f29c3629ad-c5df33d182.zip/node_modules/@gmod/gff/esm/api.js:2:9
1: import { Transform } from 'stream';
2: import { StringDecoder as Decoder } from 'string_decoder';
            ^
3: import Parser from './parse';
4: import { formatItem, formatSequence, } from './util';
error during build:
RollupError: "StringDecoder" is not exported by "__vite-browser-external", imported by ".yarn/cache/@gmod-gff-npm-1.3.0-f29c3629ad-c5df33d182.zip/node_modules/@gmod/gff/esm/api.js".
    at error (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:2125:30)
    at Module.error (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:13334:16)
    at Module.traceVariable (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:13719:29)
    at ModuleScope.findVariable (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:12234:39)
    at ChildScope.findVariable (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:6974:38)
    at ClassBodyScope.findVariable (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:6974:38)
    at ChildScope.findVariable (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:6974:38)
    at FunctionScope.findVariable (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:6974:38)
    at ChildScope.findVariable (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:6974:38)
    at Identifier.bind (file:///home/motion/Developer/vite43/.yarn/cache/rollup-npm-3.20.4-c260b8a18f-6b80ca4c45.zip/node_modules/rollup/dist/es/shared/node-entry.js:8124:40)

Validations

@stackblitz
Copy link

stackblitz bot commented Apr 18, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@Niputi Niputi added the regression The issue only appears after a new release label Apr 18, 2023
@patak-dev
Copy link
Member

It looks like the PR that introduced the regression is:

@smeng9 the reproduction you shared is a bit noisy, it would be helpful if you could try to create a smaller one to help us debug the issue.

@github-actions github-actions bot locked and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression The issue only appears after a new release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants