Take commented out code as import
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v14.17.4
- Nuxt Version:
3.0.0-rc.1
- Package Manager:
yarn@1.22.18
- Builder:
vite
- User Config:
components
,srcDir
,buildModules
,css
,build
,alias
,meta
,app
,vite
,router
,typescript
,runtimeConfig
,modules
,sitemap
- Runtime Modules:
~/modules/sitemap
- Build Modules: `@pinia/nuxt@0.1.8
Reproduction
N/A
Describe the bug
I commented out this function in composables/utils.ts
However, it seems like Nuxt still takes it as an import (composables auto imports). After I delete the code, it works fine.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Import jumps on to comment line when there is a comment #26
Given the following code block, if you run scalafix it will cause the second import to jump up a line resulting in it...
Read more >Why did Python3 execute a piece of commented-out code?
I confirmed my hypothesis from the comments, with a file like: import time def dont_run(): raise Exception("oh no i ran it") time.sleep(10) ...
Read more >commenting blocks of code removes import statements
When I uncomment the block of code I'm forced to add all the import statements again.
Read more >Writing Comments in Python (Guide)
Learn how to write Python comments that are clean, concise, and useful. Quickly get up to speed on what the best practices are,...
Read more >Best practices for writing code comments - Stack Overflow Blog
Rule 4: Comments should dispel confusion, not cause it. Rule 5: Explain unidiomatic code in comments. Rule 6: Provide links to the original ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I have the same problem on my machine.
@Lyokolux I tried reproducing on stackblitz but it’s not triggering
I can reproduce it on my local machine quite simply
The composable file simply contains the commented code
After starting
npm run dev
I can now see in the terminalNuxt project info:
Linux
v17.8.0
3.0.0-rc.3
npm@8.5.5
vite
-
-
-
The problematic line in the file
imports.mjs
isChanging the comment also changes this import, putting a typo in
export function
prevents the bug from happening. It was this effect which finally confirmed for me what was going wrong in my project. As I said, this didn’t reproduce on stackblitz, surely there’s something @potatozerg and I have in common if others haven’t reported this by now. For now I’ll give a little extra attention to what I’m commenting out.Can you try to provide a reproduction on Stackblitz close to your code ? This should however not happen 🤔