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

fix: enabling timeline breaks makro imports #507

Closed
dargmuesli opened this issue Nov 5, 2023 · 8 comments
Closed

fix: enabling timeline breaks makro imports #507

dargmuesli opened this issue Nov 5, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@dargmuesli
Copy link
Member

dargmuesli commented Nov 5, 2023

🐛 The bug

The nuxt:pages-macros-transform removes the whole line import { abortNavigation as _$__abortNavigation } from '#app';;import { __nuxtTimelineWrap } from "/home/projects/github-zpd6br/node_modules/@nuxt/devtools/dist/runtime/function-metrics-helpers";const abortNavigation = __nuxtTimelineWrap("abortNavigation", _$__abortNavigation);.

Letting abortNavigation be undefined.

🛠️ To reproduce

https://stackblitz.com/edit/github-zpd6br?file=pages%2Findex.vue

🌈 Expected behavior

const abortNavigation = __nuxtTimelineWrap("abortNavigation", _$__abortNavigation); is kept.

ℹ️ Additional context

I think this error must be fixed in nuxt, not devtools. (cc @danielroe)

@dargmuesli dargmuesli added the bug Something isn't working label Nov 5, 2023
@daniluk4000
Copy link

Got weird errors with undefined composables in our project. Disabled timeline - and all of them got fixed.

@antfu antfu closed this as completed in 923edaf Nov 11, 2023
@kylegl
Copy link

kylegl commented Jan 24, 2024

I ran into this in my project. Checked the repro above with the latest devtools and its erroring. This still seems to be an issue.

@Letsion
Copy link

Letsion commented Jan 24, 2024

The error still exists for me with version 1.0.8.
I am trying to import a composable in a Pinia store.
I get this error:
Uncaught ReferenceError: can't access lexical declaration '_$__useAxios' before initialization

@dargmuesli
Copy link
Member Author

Checked the repro above with the latest devtools and its erroring

Could you share the link? 🙏

@kylegl
Copy link

kylegl commented Jan 24, 2024

🐛 The bug

The nuxt:pages-macros-transform removes the whole line import { abortNavigation as _$__abortNavigation } from '#app';;import { __nuxtTimelineWrap } from "/home/projects/github-zpd6br/node_modules/@nuxt/devtools/dist/runtime/function-metrics-helpers";const abortNavigation = __nuxtTimelineWrap("abortNavigation", _$__abortNavigation);.

Letting abortNavigation be undefined.

🛠️ To reproduce

stackblitz.com/edit/github-zpd6br?file=pages%2Findex.vue

🌈 Expected behavior

const abortNavigation = __nuxtTimelineWrap("abortNavigation", _$__abortNavigation); is kept.

ℹ️ Additional context

I think this error must be fixed in nuxt, not devtools. (cc @danielroe)

its your repro in the initial issue

@dargmuesli
Copy link
Member Author

Yesyes, but my reproduction is from 2,5 months ago. You said that with a newer devtools version the issue reappeared, so it would be interesting to have a link to the updated reproduction you mentioned.

@kylegl
Copy link

kylegl commented Jan 24, 2024

Sorry for the confusion. Your repro package.json has nuxt/devtools: latest so it's currently using the latest version

@dargmuesli
Copy link
Member Author

Oh, I didn't know that latest updates the lockfile on every install as it seems. I've update the original reproduction to have the devtools version my bug report was intended for (v1.0.1). With that version you had:
image

With devtools v1.0.8 you have:
image

as intended. Updated fork: https://stackblitz.com/edit/github-zpd6br-2ppzmo?file=package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants