-
Notifications
You must be signed in to change notification settings - Fork 106
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
[Issue] storybook build
throws Parse error @:1:1
while storybook dev
works
#570
Comments
Hi, Storybook 7 has been released, could you try upgrading using |
I just did and it only changed the core section by removing - core: {
- builder: '@storybook/builder-vite',
- },
+ core: {}, And set versions of storybook to |
It should have also added a |
Yeah,
When trying to replicate the issue, I found out that issue is from using export default defineComponent({
props: {
firstProp: {
type: String,
default: import.meta.env.FIRST_ENV_VAR,
},
secondProp: {
type: String,
default: 'some kind of prop',
},
},
}); But I can use env vars in other places, so I found a workaround by using a variable : export default defineComponent({
props: {
firstProp: {
type: String,
- default: import.meta.env.FIRST_ENV_VAR,
+ default: ''
},
secondProp: {
type: String,
default: 'some kind of prop',
},
},
+ computed: {
+ // Actual value of firstProp
+ firstPropValue() {
+ return this.firstProp || import.meta.env.FIRST_ENV_VAR;
+ },
+ },
}); I don't think this is an issue with |
Am also seeing this issue with |
Thank you for oxypomme!you helped me fix the error!!!good guy! |
What version of
vite
are you using?4.2.1
System info and storybook versions
System:
OS: Linux 5.14 Ubuntu 20.04.2 LTS (Focal Fossa)
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
Binaries:
Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.15.0/bin/yarn
npm: 8.19.4 - ~/Documents/Work/ezreeport/node_modules/.bin/npm
Browsers:
Firefox: 111.0.1
npmPackages:
@storybook/addon-essentials: ^7.0.0 => 7.0.2
@storybook/addon-interactions: ^7.0.0 => 7.0.2
@storybook/addon-links: ^7.0.0 => 7.0.2
@storybook/addons: ^7.0.0 => 7.0.2
@storybook/blocks: ^7.0.0 => 7.0.2
@storybook/testing-library: ^0.0.13 => 0.0.13
@storybook/vue: ^7.0.0 => 7.0.2
@storybook/vue-vite: ^7.0.0 => 7.0.2
Describe the Bug
I've got an issue where running
storybook dev
works and I can access storybook through a web browser with no problems ...... while running
storybook build
throws an errorParse error @:1:1
byvite:build-import-analysis
.(I skipped
watchFiles
and hidden paths because it doesn't seems revelent and yes, I tried to fix the issue with~/mixins/ezr.vue
and it didn't solve my problem)From what I understand, the issue may be from
EzrProvider.vue
while it that seems perfectly right :I also suspect that the issue may come from
.storybook/preview.ts
or.storybook/main.ts
:I think this issue is very specific to my setup, so I can't really reproduce in a codesandbox or something (tho I really like to) so I linked to the repo at a commit where the issue happens.
Link to Minimal Reproducible Example
https://github.com/ezpaarse-project/ezreeport/tree/19622bb039ef22177222b50f01eb57f683f39c1e/src/vue
Participation
The text was updated successfully, but these errors were encountered: