Skip to content

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

@NikolayMakhonin

Description

@NikolayMakhonin

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions