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

Introduce React #2

Merged
merged 6 commits into from
Jun 16, 2021
Merged

Introduce React #2

merged 6 commits into from
Jun 16, 2021

Conversation

kjirou
Copy link
Owner

@kjirou kjirou commented Jun 16, 2021

😩 Troubleshooting

"Module not found: Error: Can't resolve 'react/jsx-runtime' in '/path/to/recalldoc/src/components'"

npm run build
(...)
ERROR in ./node_modules/react-dom/cjs/react-dom.production.min.js 12:39-63
Module not found: Error: Can't resolve 'object-assign' in '/Users/ishii.koujirou/app/recalldoc/node_modules/react-dom/cjs'
 @ ./node_modules/react-dom/index.js 35:2-63
 @ ./src/index.ts 2:0-35 54:4-10

ERROR in ./node_modules/react/cjs/react.production.min.js 9:19-43
Module not found: Error: Can't resolve 'object-assign' in '/Users/ishii.koujirou/app/recalldoc/node_modules/react/cjs'
 @ ./node_modules/react/index.js 4:2-59
 @ ./src/index.ts 1:0-38 54:11-24

ERROR in ./src/components/Searcher.tsx 1:0-63
Module not found: Error: Can't resolve 'react/jsx-runtime' in '/Users/ishii.koujirou/app/recalldoc/src/components'
 @ ./src/index.ts 3:0-49 54:25-33

3 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.39.0 compiled with 3 errors in 3041 ms
(...)

Why?

Maybe facebook/react#20235 is the cause?


Solutions

"jsx": "react-jsx" -> "jsx": "react" = 🙅‍♀️

🙆‍♀️ I don't understand why.

diff --git a/webpack.config.js b/webpack.config.js
index 408bd81..04620af 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -19,6 +19,6 @@ module.exports = {
     ],
   },
   resolve: {
-    extensions: ['.ts', '.tsx'],
+    extensions: ['.ts', '.tsx', '.js'],
   },
 }

@kjirou kjirou self-assigned this Jun 16, 2021
@kjirou kjirou force-pushed the introduce_react branch from 8274c60 to 1a547d7 Compare June 16, 2021 14:33
@kjirou kjirou marked this pull request as ready for review June 16, 2021 17:22
@kjirou kjirou merged commit 0ca6cc4 into main Jun 16, 2021
@kjirou kjirou deleted the introduce_react branch June 16, 2021 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant