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

[vite-plugin-svelte-kit] Package subpath './helpers/esm/asyncToGenerator.js' is not defined by "exports" #9331

Closed
7 tasks done
NikolayMakhonin opened this issue Jul 24, 2022 · 2 comments

Comments

@NikolayMakhonin
Copy link

NikolayMakhonin commented Jul 24, 2022

Describe the bug

vite 3.0.2 writes imports to bundle incorrectly, but vite2 works fine:

main.js

import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
console.log(_asyncToGenerator);

build command:

vite build --ssr main.js

dist/main.mjs

import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator.js";
console.log(_asyncToGenerator);

there should not be the .js extensions, because the direct paths is restricted by the @babel/runtime-corejs3/package.json

Reproduction

See this repo

System Info

System:                                                 
    OS: Windows 10 10.0.19042                             
    CPU: (8) x64 Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz
    Memory: 6.11 GB / 15.89 GB                            
  Binaries:
    Node: 16.15.1 - E:\Program Files\nodejs\node.EXE      
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD        
    npm: 8.11.0 - E:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (103.0.1264.62)
    Internet Explorer: 11.0.19041.906

Used Package Manager

pnpm

Logs

No response

Validations

@NikolayMakhonin
Copy link
Author

I think it related with #8420
The error appears since the 3.0.0-alpha.8 version, because the 3.0.0-alpha.7 generates cjs module

@sapphi-red
Copy link
Member

Closing as I confirmed this is fixed in 4.1.0+.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2023
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