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 build using old cached source file? #7176

Closed
7 tasks done
glittle opened this issue Mar 5, 2022 · 6 comments
Closed
7 tasks done

vite build using old cached source file? #7176

glittle opened this issue Mar 5, 2022 · 6 comments

Comments

@glittle
Copy link
Contributor

glittle commented Mar 5, 2022

Describe the bug

I had an unterminated string constant in a Vue file.

As expected, the 'server.hmr.overlay' showed the error and the line that caused it...

[plugin:vite:eslint] C:\myproject\src\pages\LoginPage.vue
  59:11  error  Parsing error: Unterminated string constant. (49:11)

✖ 1 problem (1 error, 0 warnings)
C:/myproject/src/pages/LoginPage.vue
    at formatError (C:\myproject\node_modules\vite\dist\node\chunks\dep-f9d9421a.js:38082:46)
    at TransformContext.error (C:\myproject\node_modules\vite\dist\node\chunks\dep-f9d9421a.js:38078:19)
    at TransformContext.transform (C:\myproject\node_modules\vite-plugin-eslint\dist\index.js:87:14)
    at async Object.transform (C:\myproject\node_modules\vite\dist\node\chunks\dep-f9d9421a.js:38318:30)
    at async doTransform (C:\myproject\node_modules\vite\dist\node\chunks\dep-f9d9421a.js:53014:29
Click outside or fix the code to dismiss.

I fixed the error and saved the file.

The same error was displayed again.

In attempting to resolve this, I edited the file a number of times and stopped and started the vite process.

Two ways to resolve the issue:

  • copy the file content to a new file with the same name, replacing the old file
  • rename the file and update code to reference the renamed new file

Reproduction

Not possible.

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
    Memory: 14.45 GB / 31.83 GB
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 98.0.4758.102
    Edge: Spartan (44.19041.1266.0), Chromium (98.0.1108.55)
    Internet Explorer: 11.0.19041.1202

Used Package Manager

npm

Logs

Log lines included in the description above.

Validations

@glittle
Copy link
Contributor Author

glittle commented Mar 5, 2022

The page in question is loaded with this line:

import LoginPage from "@/pages/LoginPage.vue";

@glittle
Copy link
Contributor Author

glittle commented Mar 5, 2022

The builder seems to be using a cached file... but only after the "Unterminated string constant" error.

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

Hello @glittle. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@glittle
Copy link
Contributor Author

glittle commented Mar 5, 2022

The bot has marked this for deletion because a repo was not provided. As explained, it cannot be.

@bluwy
Copy link
Member

bluwy commented Mar 5, 2022

If there's no repro, there's no way for us to fix it. The behaviour described alone isn't enough to figure the source of the bug.

@glittle
Copy link
Contributor Author

glittle commented Mar 5, 2022

Yes, I understand. We can let this be closed. I've got a workaround for when it happens again. And if someone else encounters the same issue, maybe this report will be a another clue to help identify the cause.

If the build system doesn't do any caching, then maybe there was some glitch in the environment. If there is any sort of caching, maybe it should be reviewed to ensure that this can't happen.

Thanks, @bluwy, for carrying forward the conversation. As mentioned, I'm fine with letting this issue be closed.

@bluwy bluwy closed this as completed Mar 5, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2022
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