Solucionado (ver solução)
Solucionado
(ver solução)
7
respostas

Erro ao rodar yarn storybook

Ao o comando

yarn storybook

dá os seguintes erros:

TypeError: Cannot set property createEmitAndSemanticDiagnosticsBuilderProgram of #<Object> which has only a getter
    at Function.assign (<anonymous>)
    at patchSkipGetSyntacticDiagnostics (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/builder-webpack4/node_modules/fork-ts-checker-webpack-plugin/lib/patchTypescript.js:30:12)
    at Object.patchTypescript (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/builder-webpack4/node_modules/fork-ts-checker-webpack-plugin/lib/patchTypescript.js:43:9)
    at Object.<anonymous> (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/builder-webpack4/node_modules/fork-ts-checker-webpack-plugin/lib/service.js:68:19)
    at Module._compile (node:internal/modules/cjs/loader:1191:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47
70% sealing React Docgen Typescript Plugin/Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/generateDocgenCodeBlock.js:37
    return insertTsIgnoreBeforeStatement(typescript_1.default.createExpressionStatement(typescript_1.default.createBinary(typescript_1.default.createPropertyAccess(typescript_1.default.createIdentifier(d.displayName), typescript_1.default.createIdentifier("displayName")), typescript_1.default.SyntaxKind.EqualsToken, typescript_1.default.createLiteral(d.displayName))));
TypeError: typescript_1.default.createIdentifier is not a function
    at setDisplayName (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/generateDocgenCodeBlock.js:37:186)
    at /Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/generateDocgenCodeBlock.js:201:34
    at Array.map (<anonymous>)
    at Object.generateDocgenCodeBlock (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/generateDocgenCodeBlock.js:200:46)
    at processModule (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/plugin.js:67:44)
    at /Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/plugin.js:233:49
    at Array.forEach (<anonymous>)
    at /Users/renanazevedo/Projects/alurabooks-ds/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/plugin.js:233:34
    at SyncHook.eval [as call] (eval at create (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:19:1)
    at SyncHook.lazyCompileHook (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.seal (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/webpack/lib/Compilation.js:1284:19)
    at /Users/renanazevedo/Projects/alurabooks-ds/node_modules/webpack/lib/Compiler.js:675:18
    at /Users/renanazevedo/Projects/alurabooks-ds/node_modules/webpack/lib/Compilation.js:1261:4
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:22:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.finish (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/webpack/lib/Compilation.js:1253:28)
    at /Users/renanazevedo/Projects/alurabooks-ds/node_modules/webpack/lib/Compiler.js:672:17
    at _done (eval at create (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at eval (eval at create (/Users/renanazevedo/Projects/alurabooks-ds/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:47:22)
    at /Users/renanazevedo/Projects/alurabooks-ds/node_modules/webpack/lib/Compilation.js:1185:12
    at /Users/renanazevedo/Projects/alurabooks-ds/node_modules/webpack/lib/Compilation.js:1097:9
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

minha versão do node é a v16.19.1

7 respostas

Salve, Renan!

Consegue compartilhar o repositório do seu projeto pra gente analisar e tentar entender o que se passa?

Vinicios, desculpe pela demora

segue o link do repositorio:

https://github.com/renanaazevedo/alurabooks-ds

Vinicios, notei que eu não estava na versão correta do node (v16.13.2). Então recriei o projeto nesta versão. No entanto, ao rodar yarn storybook, aparece o seguinte erro:

yarn run v1.22.19
$ start-storybook -p 6006
/bin/sh: start-storybook: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
solução!

Experimenta rodar esse projeto base, Renan:

https://github.com/viniciosneves/ds-alurabooks-base

é um projeto limpo do TS DX.

Vinicios,

Deu certo!!!

Com esse projeto consegui levantar o storybook.

O que você fez para criar esse projeto?

Pergunto porque o projeto que criei tambem é um projeto básico do TSDX com storybook mas não levanta.

Parece que depende do sistema operacional, Renan!

Em qual SO vc criou esse projeto? O meu projeto foi criado no Mac OS X Ventura