Closed dawnmist closed 11 months ago
Thanks for opening this! To be clear, did you experience this issue in the foundations workshop? Because this workshop doesn't include @mswjs/data
as a dependency. Did you perhaps have this issue in the web forms workshop?
I think the proper fix would be to just add msw
to the affected projects. I just want to make sure I understand correctly where you're experiencing this issue.
Nevermind, I was looking in the wrong place. I'll get this fixed. Thanks!
When starting on this exercise, as soon as I tried to use the imported db the app would fail to compile, complaining that
msw
was not installed but required by@mswjs/data
.It took me almost 45 minutes to track down that the error was due to an old and long forgotten setting in my
~/.npmrc
file that disabled installing optional dependencies, and sincemsw
was an optional dependency for@mswjs/data
it therefore wasn't being installed.It may be worth adding a comment or trouble-shooting step that if the compiler is not able to compile the project due to a dependency being missing, and the dependency is listed as an optional dependency, to check that you haven't accidentally disabled installing optional dependencies in an old
~/.npmrc
file.To reproduce:
optional=false
to the filenpm run setup
npm run start
Errors encountered when compiling (complete with hint from npm that there was something going on with optional deps, but that caused additional confusion because it was saying that the default if the options were omitted were that they were to be installed but didn't say that I had a local npmrc option that was overriding the default and since I hadn't used the command line parameters it didn't make sense as to why it wasn't then being installed):