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
but that doesn't seem to be valid in windows - you can't set environment variables that way in windows. I tried seeing if webpack pays attention to config but it doesn't seem to.
Install cross-env and set the variable that way, also suggested as a solution here
Manipulate the environment variable somewhere else, like in webpack.config.ts
That webpack ticket is followed up with some webpack documentation that suggests the cross-env solution is the right one, though I suspect since grafana generates the webpack.config.ts they might have other ideas that don't bring in another dependency.
The text was updated successfully, but these errors were encountered:
jackw
changed the title
create-plugin:migrate tries to set env vars in unix-specific ways (breaks on windows)
Migrate: Env vars break in Windows
Oct 17, 2022
When using toolkit create-plugin:migrate this gets generated:
but that doesn't seem to be valid in windows - you can't set environment variables that way in windows. I tried seeing if webpack pays attention to config but it doesn't seem to.
Initially this seemed to work as it runs the right thing:
However, after that there are a lot of other errors. They all seem to be related to the fact that config didn't actually set TS_NODE_PROJECT...
I noticed webpack has an --env parameter, so I tried this:
but this didn't work. Reading the docs on that that sets a webpack environment variable, which is not the same as an OS environment variable.
Chasing through the cause of this, I found this old webpack issue that completely describes the problem and suggests suggest two ideas:
cross-env
and set the variable that way, also suggested as a solution hereThat webpack ticket is followed up with some webpack documentation that suggests the cross-env solution is the right one, though I suspect since grafana generates the webpack.config.ts they might have other ideas that don't bring in another dependency.
The text was updated successfully, but these errors were encountered: