analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.5k stars 240 forks source link

May have found an issue when installing Storybook #249

Closed jonnycraze closed 1 year ago

jonnycraze commented 1 year ago

Please provide the environment you discovered this bug in.

Procution

Which area/package is the issue in?

create-analog

Description

node_modules

Please provide the exception or error you saw

Other information

I recently created a new project using analogjs, and wanted to install storybook. After the installation, I could not get storybook to run, it threw a few errors but the error of note was that 'src/types' could not be found on the following line:

{ RequestHeaders as RequestHeaders$1 } from 'src/types';

When I opened node_modules/h3 it seemed like this package was not properly installed. I uninstalled it and storybook ran without any issues. I then reinstalled h3 directly:

npm i h3

This appears to have correctly installed h3, everything builds and resolves as expected in storybook, and on the development server running. I assume there may some type of dependency clash but I wasn't able to pinpoint it. Regardless I wanted to report what I experienced and how I fixed it in the case that someone else runs into this.

I would be willing to submit a PR to fix this issue

brandonroberts commented 1 year ago

Thanks @jonnycraze. Will you provide a GitHub repo or steps to reproduce the issue?

himyjan commented 1 year ago

analog with storybook v7 using storybook Angular 16 webpack 5 file

h3 type error

yarn create analog
npx storybook@latest init
yarn run storybook

https://github.com/himyjan/Storybook-v7-Vite4-webpack5-Angular16-React18-Vue3-TypeScript/tree/main/storybook-webpack5-analog

error message

Error: node_modules/h3/dist/index.d.ts:106:39 - error TS2552: Cannot find name 'FetchEvent'. Did you mean 'TouchEvent'?

106 declare class H3Event implements Pick<FetchEvent, "respondWith"> {


  node_modules/typescript/lib/lib.dom.d.ts:14401:13
    14401 declare var TouchEvent: {
'TouchEvent' is declared here.

at addError (/Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/@ngtools/webpack/src/ivy/diagnostics.js:31:27)
at /Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/@ngtools/webpack/src/ivy/diagnostics.js:18:9
at AngularWebpackPlugin.updateJitProgram (/Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/@ngtools/webpack/src/ivy/plugin.js:401:5)
at AngularWebpackPlugin.setupCompilation (/Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/@ngtools/webpack/src/ivy/plugin.js:180:87)
at /Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/@ngtools/webpack/src/ivy/plugin.js:120:14
at Hook.eval [as call] (eval at create (/Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/tapable/lib/HookCodeFactory.js:14:14), <anonymous>:19:1)
at Hook.CALL_DELEGATE [as _call] (/Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/tapable/lib/Hook.js:11:15)
at Compiler.newCompilation (/Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/Compiler.js:881:32)
at /Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/@storybook/builder-webpack5/node_modules/webpack/lib/Compiler.js:921:32
at _next0 (eval at create (/Users/user/Desktop/Storybook-v7-Beta-Vite4-webpack5-Angular15-React18-Vue3-TypeScript/storybook-webpack5-analog/node_modules/tapable/lib/HookCodeFactory.js:28:14), <anonymous>:41:1)

? Would you like to help improve Storybook by sending anonymous crash reports? › (Y/n)

brandonroberts commented 1 year ago

Try this with the latest release and re-open if its still an issue