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 with @rollup/plugin-babel updating vite 3.1.5 #10357

Closed
g-battaglia-h-farm opened this issue Oct 6, 2022 · 1 comment
Closed

Error with @rollup/plugin-babel updating vite 3.1.5 #10357

g-battaglia-h-farm opened this issue Oct 6, 2022 · 1 comment

Comments

@g-battaglia-h-farm
Copy link

Describe the bug

Hi,

I updated to vite 3.1.5 and I got this error using @rollup/plugin-babel:

failed to load config from [...]/vite.config.js
error during build:
[...]/vite.config.js.timestamp-1665053909267.mjs:7
import { getBabelOutputPlugin } from [...]/node_modules/@rollup/plugin-babel/dist/index.es.js";
         ^^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'getBabelOutputPlugin' not found. The requested module 

I fixed it rolling back to 3.1.4

Reproduction

System Info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 268.20 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.9.0 - /opt/homebrew/bin/node
    npm: 8.19.1 - /opt/homebrew/bin/npm
  Browsers:
    Brave Browser: 106.1.44.101
    Chrome: 105.0.5195.125
    Firefox: 105.0.1
    Safari: 16.0
  npmPackages:
    vite: ^3.1.4 => 3.1.5

Used Package Manager

npm

Logs

```bash
failed to load config from /Users/giacomo.battaglia/dev/station-finder-uta/vite.config.js
error during build:
[...]/vite.config.js.timestamp-1665054145412.mjs:7
import { getBabelOutputPlugin } from "[...]/node_modules/@rollup/plugin-babel/dist/index.es.js";
         ^^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'getBabelOutputPlugin' not found. The requested module '[...]/node_modules/@rollup/plugin-babel/dist/index.es.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '[...]/node_modules/@rollup/plugin-babel/dist/index.es.js';
const { getBabelOutputPlugin } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:527:24)
    at async loadConfigFromBundledFile ([...]/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:63505:21)
    at async loadConfigFromFile ([...]/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:63400:28)
    at async resolveConfig ([...]/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:63017:28)
    at async doBuild ([...]/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:45673:20)
    at async build ([...]/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:45662:16)
    at async CAC.<anonymous> ([...]/node_modules/vite/dist/node/cli.js:748:9)
    ```
    ```

### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitejs.dev/guide).
- [X] Check that there isn't [already an issue](https://github.com/vitejs/vite/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to [vuejs/core](https://github.com/vuejs/core) instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@bluwy
Copy link
Member

bluwy commented Oct 6, 2022

fixed in 3.1.6

@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants