You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a simple test writing my first pinia store I wanted to log to the console the values of some settings we store in the env files.
This worked fine in dev mode, but when doing a build I got an error:
[vite:build-import-analysis] Parse error @:1:1
file: C:/git/test-app/src/stores/test.ts
error during build:
Error: Parse error @:1:1
at parse$e (file:///C:/git/test-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:16497:355)
at Object.transform (file:///C:/git/test-app/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:46642:27)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
ERROR: "build-only" exited with 1.
This didn't have a lot of information (just the file name) and was difficult to track down, but it came down to lines like this:
The problem is the first parameter, the string. If I replace the first period with a space, it builds. According to the docs, it should replace the values even inside strings which I didn't think about, but instead it gives me this parse error and no line number to look at. In dev mode the value is not replaced inside the string so it works fine.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
As a simple test writing my first pinia store I wanted to log to the console the values of some settings we store in the env files.
This worked fine in dev mode, but when doing a build I got an error:
This didn't have a lot of information (just the file name) and was difficult to track down, but it came down to lines like this:
The problem is the first parameter, the string. If I replace the first period with a space, it builds. According to the docs, it should replace the values even inside strings which I didn't think about, but instead it gives me this parse error and no line number to look at. In dev mode the value is not replaced inside the string so it works fine.
Reproduction
https://github.com/jasong-au/test-app-error
Steps to reproduce
Create new app, add a variable to .env, attempt to include the import in a single quoted string.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: