Expected result: build correctly as it runs in local. Typescript added as a dependency and dev-dependency already. Cannot seem to be able to find it on build time.
Hi,
I am running a Nextjs site. My build keeps crashing and requesting to add typescript to the dependencies, although it is listed and installed as a dependency:
"typescript": "^4.8.4"
I have already tried adding it as a dependency, as a dev dependency, as well as declaring them them both. The build runs perfectly locally.
this is the error message:
" info - Linting and checking validity of types…
17:30:01.814 It looks like you’re trying to use TypeScript but do not have the required package(s) installed.
17:30:01.814
17:30:01.814 Please install typescript by running:
17:30:01.814
17:30:01.814 npm install --save-dev typescript
17:30:01.814
17:30:01.815 If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).
17:30:01.815
17:30:01.864 Failed: build command exited with code: 1
17:30:04.972 Failed: an internal error occurred"
Yarn gives much information about what was going on…
somehow it is looking for @storybook/react and its types in the dependencies, even if they are already declared as dev-dependencies
“Transforming async functions to the configured target environment (“es5”) is not supported yet”, “Transforming destructuring to the configured target environment (“es5”) is not supported yet”…
changed target in compiler tsconfig to es6 (crossing fingers it does not have a side effect)
It is building it now. Apparently all okay. Hope it helps!