Skip to content
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

[Bug]: TsConfig solution-style throws warning #19974

Open
evtk opened this issue Nov 25, 2022 · 3 comments
Open

[Bug]: TsConfig solution-style throws warning #19974

evtk opened this issue Nov 25, 2022 · 3 comments

Comments

@evtk
Copy link

evtk commented Nov 25, 2022

Describe the bug

Running Storybook for Angular. I have a tsconfig project that contains the solution-style setup. But running storybook throws a bunch of warnings on this:

6% setup before compile angular-compiler<i> [webpack-dev-middleware] wait until bundle finished
Warning: The inferred tsconfig file "/Users/**/Documents/git/storybook-playground/tsconfig.json" appears to be "solution-style" since it contains no root files but does contain project references.
This is probably not wanted, since ngcc is unable to infer settings like "paths" mappings from such a file.
Perhaps you should have explicitly specified one of the referenced projects using the --tsconfig option. For example:

  ngcc ... --tsconfig "./tsconfig.app.json"
  ngcc ... --tsconfig "./tsconfig.ide.json"
  ngcc ... --tsconfig "./tsconfig.spec.json"

Find out more about solution-style tsconfig at https://devblogs.microsoft.com/typescript/announcing-typescript-3-9/#solution-style-tsconfig.
If you did intend to use this file, then you can hide this warning by providing it explicitly:

  ngcc ... --tsconfig "tsconfig.json"

What I don't get is why Storybook would catch that tsconfig file, since I have configured the setup to use the tsconfig.json inside the .storybook folder. And this tsconfig is based on the tsconfig.app.json in the root.

        "storybook": {
          "builder": "@storybook/angular:start-storybook",
          "options": {
            "tsConfig": ".storybook/tsconfig.json",     <------ NOTICE
            "browserTarget": "storybook-playground:build:production",
            "port": 6006
          }
        },

Why do I still get this logging?

To Reproduce

https://github.com/evtk/storybook-playground

System

Environment Info:

  System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 16.18.0 - /opt/homebrew/opt/node@16/bin/node
    npm: 8.19.2 - /opt/homebrew/opt/node@16/bin/npm
  Browsers:
    Chrome: 107.0.5304.121
    Safari: 16.1

Additional context

No response

@eBitzu
Copy link

eBitzu commented Feb 27, 2023

hi @evtk I looked into the read.me file
https://github.com/storybookjs/storybook/blob/next/code/frameworks/angular/README.md

The option tsconfig is not a valid one for either of the configurations: storybook or build-storybook.
I'll get back to you if I manage to find a way to do this.

@eBitzu
Copy link

eBitzu commented Feb 27, 2023

hi @evtk just add this to .storybook/main.js

"typescript": { check: true, checkOptions: { tsconfig: "./tsconfig.json" } } }

Source: https://storybook.js.org/docs/angular/configure/typescript

@evtk
Copy link
Author

evtk commented Feb 27, 2023

Hi @eBitzu thanks for checking in. I just tried your suggested fix, but the warning doesn't disappear.

evtk/storybook-playground@ebaca7b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants