-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Cannot find module './logo.svg' using custom react-scripts and Typescript template #8223
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
Comments
Applying that fix resolved the issue for me, thanks @DalderupMaurice ! |
For me it was eslint deciding to lint Fixed it from
To:
NOTE: the space b/w first too forward slashes. |
Just wanted to comment here that this is still an issue as of v3.4.1. If I checkout v3.4.1, go to
then CRA will still add a
and the logo will thus fail to be imported, since the default If I manually change I am curious as to at which point during the project creation process this file gets added, and whether it can be configured to reference the custom |
I just ran into this issue and was able to change the react-app-env.d.ts file in the template by making this change to /packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js. Which fixed the
to
|
There's a similar fix in the PR listed in my original issue. It was closed by @mrmckeb in #5827 (comment) in favor of #5877 but both PRs have been closed. I assume the first one shouldn't have been closed, knowing that the 2nd one wouldn't be merged? |
Copy code from |
Isn't there any option at the I've tried using + "references": [
+ {"path": "./node_modules/react-scripts/lib/react-app.d.ts"}
+ ] (Actually I'm 90% sure there isn't such option at |
Is your proposal related to a problem?
Yes.
When I forked this repo and re-published version 3.3.0 of react-scripts (WITHOUT ANY CHANGES!) under my own organization on npmjs, I was unable to successfully build/start a project using these custom scripts.
Steps used:
npx create-react-app my-app --template typescript --scripts-version my-custom-scripts-on-npm
yarn start
Describe the solution you'd like
After wandering around, I managed to fix this by doing the following:
react-app-env.d.ts
in thesrc
folder of your CRA project/// <reference types="react-scripts" />
to/// <reference types="your-custom-published-react-scripts-name-here" />
Describe alternatives you've considered
/
Additional context
A pr has already been proposed to fix this issue, but it has been closed
Reference issue: #5875
Reference PR: #5827
I am not sure why this change didn't come through, but it remains an issue to date.
The text was updated successfully, but these errors were encountered: