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

Sourcemaps have offset if code contains defineAsyncComponent with dynamic import #12634

Closed
7 tasks done
eran-swimm opened this issue Mar 28, 2023 · 1 comment · Fixed by #12642
Closed
7 tasks done
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@eran-swimm
Copy link

Describe the bug

We are compiling and building for production using vite.
We have a file has async component with dynamic import.
Source map of latter declaration have offset.

Reproduction

https://github.com/eran-swimm/source-map-example

Steps to reproduce

git clone [email protected]:eran-swimm/source-map-example.git
cd source-map-example
pnpm install
pnpm build
pnpm preview

The example is based on the pnpm create vite example with typescript and vue.js.

The main page has two buttons, one to call method1 and one to call method 2. Both methods have debugger statement in their body.

method1 is defined before the async component, when calling method1, the debugger stops at the right line. All definitions are in the HelloWorld component
image

method2 is defined after the async component, when calling method2, the debugger stops in one line offset

image

System Info

System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 184.52 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.0/bin/yarn
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 111.0.5563.110
    Firefox: 111.0.1
    Safari: 16.3

Used Package Manager

pnpm

Logs

No response

Validations

@eran-swimm eran-swimm changed the title Sourcemaps have offset if code contains defineAsyncComponent with @import Sourcemaps have offset if code contains defineAsyncComponent with dynamic import Mar 29, 2023
@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Mar 29, 2023
@eran-swimm
Copy link
Author

thanks 🙏

@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants