Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/builders/builder-vite/input/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
// doesn't fail (it will simply be disabled)
window.module = undefined;
window.global = window;
// prevent: "ReferenceError: process is not defined"
window.process = window.process || {};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package manager cli code shouldn't be running in the iframe, should it?

I would not want to merge this PR with this change, but I think you're doing it just for troubleshooting.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually...

I am running into this:
https://app.circleci.com/pipelines/github/storybookjs/storybook/64114/workflows/6ea5ea73-052c-4872-8329-316db3da94c3/jobs/598100

To be specific:
https://6308736456ad2046275c0ae7-hzqlbitzzd.chromatic.com

To be even more specific:
https://6308736456ad2046275c0ae7-hzqlbitzzd.chromatic.com/?path=/story/stories-renderers-svelte-args--remount-on-reset-story-args

process is not defined
ReferenceError: process is not defined
    at https://6308736456ad2046275c0ae7-hzqlbitzzd.chromatic.com/assets/index-cmme_mpW.js:395:7384

I tried bundling in the plugin, and that resulted in that error, but even after reverting that, I'm still seeing that.
I think it might just be how vite5 works?

So, I'm trying anything I can to get CI green. Been trying all day.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it's still broken, even with this...

</script>
<!-- [HEAD HTML SNIPPET HERE] -->
</head>
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/svelte-vite/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const viteFinal: NonNullable<StorybookConfig['viteFinal']> = async (confi
// TODO: set up eslint import to use typescript resolver
// eslint-disable-next-line import/no-unresolved
const { svelte, loadSvelteConfig } = await import('@sveltejs/vite-plugin-svelte');
const svelteConfig = await loadSvelteConfig();
const svelteConfig = await loadSvelteConfig({}, {});

// Add svelte plugin if the user does not have a Vite config of their own
if (!(await hasVitePlugins(plugins, ['vite-plugin-svelte']))) {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"peerDependencies": {
"svelte": "^3.0.0 || ^4.0.0",
"vite": "^4.0.0"
"vite": "^4.0.0 || ^5.0.0"
},
"engines": {
"node": "^14.18 || >=16"
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/js-package-manager/NPMProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class NPMProxy extends JsPackageManager {
await this.executeCommand({
command: 'npm',
args: ['install', ...args, ...this.getInstallArgs()],
stdio: ['ignore', logStream, logStream],
stdio: process.env.CI ? 'inherit' : ['ignore', logStream, logStream],
});
} catch (err) {
const stdout = await readLogFile();
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/js-package-manager/PNPMProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class PNPMProxy extends JsPackageManager {
await this.executeCommand({
command: 'pnpm',
args: ['add', ...args, ...this.getInstallArgs()],
stdio: ['ignore', logStream, logStream],
stdio: process.env.CI ? 'inherit' : ['ignore', logStream, logStream],
});
} catch (err) {
const stdout = await readLogFile();
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/js-package-manager/Yarn1Proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class Yarn1Proxy extends JsPackageManager {
await this.executeCommand({
command: 'yarn',
args: ['add', ...this.getInstallArgs(), ...args],
stdio: ['ignore', logStream, logStream],
stdio: process.env.CI ? 'inherit' : ['ignore', logStream, logStream],
});
} catch (err) {
const stdout = await readLogFile();
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/js-package-manager/Yarn2Proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class Yarn2Proxy extends JsPackageManager {
await this.executeCommand({
command: 'yarn',
args: ['add', ...this.getInstallArgs(), ...args],
stdio: ['ignore', logStream, logStream],
stdio: process.env.CI ? 'inherit' : ['ignore', logStream, logStream],
});
} catch (err) {
const stdout = await readLogFile();
Expand Down
2 changes: 1 addition & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/experimental-utils": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"@vitejs/plugin-react": "^2.1.0",
"@vitejs/plugin-react": "^3.0.1",
"babel-eslint": "^10.1.0",
"babel-loader": "^9.1.2",
"chromatic": "7.1.0",
Expand Down
54 changes: 14 additions & 40 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/plugin-transform-react-jsx-development@npm:^7.16.7, @babel/plugin-transform-react-jsx-development@npm:^7.18.6, @babel/plugin-transform-react-jsx-development@npm:^7.22.5":
"@babel/plugin-transform-react-jsx-development@npm:^7.16.7, @babel/plugin-transform-react-jsx-development@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/plugin-transform-react-jsx-development@npm:7.22.5"
dependencies:
Expand Down Expand Up @@ -1720,7 +1720,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/plugin-transform-react-jsx@npm:^7.14.9, @babel/plugin-transform-react-jsx@npm:^7.19.0, @babel/plugin-transform-react-jsx@npm:^7.22.15, @babel/plugin-transform-react-jsx@npm:^7.22.5":
"@babel/plugin-transform-react-jsx@npm:^7.14.9, @babel/plugin-transform-react-jsx@npm:^7.22.15, @babel/plugin-transform-react-jsx@npm:^7.22.5":
version: 7.22.15
resolution: "@babel/plugin-transform-react-jsx@npm:7.22.15"
dependencies:
Expand Down Expand Up @@ -7455,7 +7455,7 @@ __metadata:
"@typescript-eslint/eslint-plugin": "npm:^5.45.0"
"@typescript-eslint/experimental-utils": "npm:^5.45.0"
"@typescript-eslint/parser": "npm:^5.45.0"
"@vitejs/plugin-react": "npm:^2.1.0"
"@vitejs/plugin-react": "npm:^3.0.1"
babel-eslint: "npm:^10.1.0"
babel-loader: "npm:^9.1.2"
chromatic: "npm:7.1.0"
Expand Down Expand Up @@ -7667,7 +7667,7 @@ __metadata:
vite: "npm:^4.0.0"
peerDependencies:
svelte: ^3.0.0 || ^4.0.0
vite: ^4.0.0
vite: ^4.0.0 || ^5.0.0
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -7986,8 +7986,8 @@ __metadata:
linkType: hard

"@sveltejs/vite-plugin-svelte@npm:^2.4.2":
version: 2.4.6
resolution: "@sveltejs/vite-plugin-svelte@npm:2.4.6"
version: 2.5.2
resolution: "@sveltejs/vite-plugin-svelte@npm:2.5.2"
dependencies:
"@sveltejs/vite-plugin-svelte-inspector": "npm:^1.0.4"
debug: "npm:^4.3.4"
Expand All @@ -7997,9 +7997,9 @@ __metadata:
svelte-hmr: "npm:^0.15.3"
vitefu: "npm:^0.2.4"
peerDependencies:
svelte: ^3.54.0 || ^4.0.0
svelte: ^3.54.0 || ^4.0.0 || ^5.0.0-next.0
vite: ^4.0.0
checksum: de7d844bf5fc12aa4caf352f5825d58f6747eef68301a492128ea6756c3c193f1d1e1f75975abd4fdfb50f5a4ff45016a94f40c29e1b0121095c63f6bc10e219
checksum: 79c4a8a24e57aec113dc120c9a7912d3458f77c3ad4b55c2b380a1e21897de7e701efadf4f037a0ce3c33ebdbe21802cc3adfba51b26f107dbf425945013c991
languageName: node
linkType: hard

Expand Down Expand Up @@ -9758,23 +9758,6 @@ __metadata:
languageName: node
linkType: hard

"@vitejs/plugin-react@npm:^2.1.0":
version: 2.2.0
resolution: "@vitejs/plugin-react@npm:2.2.0"
dependencies:
"@babel/core": "npm:^7.19.6"
"@babel/plugin-transform-react-jsx": "npm:^7.19.0"
"@babel/plugin-transform-react-jsx-development": "npm:^7.18.6"
"@babel/plugin-transform-react-jsx-self": "npm:^7.18.6"
"@babel/plugin-transform-react-jsx-source": "npm:^7.19.6"
magic-string: "npm:^0.26.7"
react-refresh: "npm:^0.14.0"
peerDependencies:
vite: ^3.0.0
checksum: 85fe5c740fbe8aa5dd4c3516a02a937dff0e2b0858cfa7cf8a69b998b7d05e08c296a087fde66f9171367f5c9d10d6e4bc026df1fa1e2ec528f49e7eaabeeae1
languageName: node
linkType: hard

"@vitejs/plugin-react@npm:^3.0.1":
version: 3.1.0
resolution: "@vitejs/plugin-react@npm:3.1.0"
Expand Down Expand Up @@ -21226,15 +21209,6 @@ __metadata:
languageName: node
linkType: hard

"magic-string@npm:^0.26.7":
version: 0.26.7
resolution: "magic-string@npm:0.26.7"
dependencies:
sourcemap-codec: "npm:^1.4.8"
checksum: 950035b344fe2a8163668980bc4a215a0b225086e6e22100fd947e7647053c6ba6b4f11a04de83a97a276526ccb602ef53b173725dbb1971fb146cff5a5e14f6
languageName: node
linkType: hard

"magic-string@npm:^0.27.0":
version: 0.27.0
resolution: "magic-string@npm:0.27.0"
Expand All @@ -21244,7 +21218,7 @@ __metadata:
languageName: node
linkType: hard

"magic-string@npm:^0.30.0, magic-string@npm:^0.30.3":
"magic-string@npm:^0.30.0":
version: 0.30.4
resolution: "magic-string@npm:0.30.4"
dependencies:
Expand All @@ -21253,7 +21227,7 @@ __metadata:
languageName: node
linkType: hard

"magic-string@npm:^0.30.5":
"magic-string@npm:^0.30.3, magic-string@npm:^0.30.5":
version: 0.30.5
resolution: "magic-string@npm:0.30.5"
dependencies:
Expand Down Expand Up @@ -30270,14 +30244,14 @@ __metadata:
linkType: hard

"vitefu@npm:^0.2.4":
version: 0.2.4
resolution: "vitefu@npm:0.2.4"
version: 0.2.5
resolution: "vitefu@npm:0.2.5"
peerDependencies:
vite: ^3.0.0 || ^4.0.0
vite: ^3.0.0 || ^4.0.0 || ^5.0.0
peerDependenciesMeta:
vite:
optional: true
checksum: 78d5e7071c0c4fdfc010f15a3e5bac2d31090ddd48789446fce5b7d0f01496fc6a041b65d3add904365bb0ac6576bb93635f700971c16ffd27cd7c0bee9eb1ae
checksum: 5781ece3025b6be0eb87ee7d97760a7721b1c6c5ad60ede5f37c86393ece3c8fce4245472f62368eb192448034086e25bdcadf098eefc271277176ab9a430204
languageName: node
linkType: hard

Expand Down
6 changes: 3 additions & 3 deletions scripts/utils/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const addWorkaroundResolutions = async ({ cwd, dryRun }: YarnOptions) =>
const packageJson = await readJSON(packageJsonPath);
packageJson.resolutions = {
...packageJson.resolutions,
'@vitejs/plugin-react': '^4.0.0', // due to conflicting version in @storybook/vite-react
// '@vitejs/plugin-react': '^4.0.0', // due to conflicting version in @storybook/vite-react
};
await writeJSON(packageJsonPath, packageJson, { spaces: 2 });
};
Expand All @@ -87,8 +87,8 @@ export const configureYarn2ForVerdaccio = async ({ cwd, dryRun, debug }: YarnOpt
// We need to be able to update lockfile when bootstrapping the examples
`yarn config set enableImmutableInstalls false`,
// Discard all YN0013 - FETCH_NOT_CACHED messages
// Error on YN0060 - INCOMPATIBLE_PEER_DEPENDENCY
`yarn config set logFilters --json '[ { "code": "YN0013", "level": "discard" }, { "code": "YN0060", "level": "error" } ]'`,
// Error on YN0060 - INCOMPATIBLE_PEER_DEPENDENCY (disabled temporarily, sorry)
`yarn config set logFilters --json '[ { "code": "YN0013", "level": "discard" }, { "code": "YN0060", "level": "warning" } ]'`,
];

await exec(
Expand Down