Closed timscott closed 1 year ago
Ruby version: 3.1.2 Rails version: 6.1.6.1 Webpacker version: 5.4.3
Expected behavior: Compile app/javascript/internal/components/Events/index.tsx
app/javascript/internal/components/Events/index.tsx
Actual behavior:
Error: Module parse failed: Unexpected token (6:4) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
I ran:
$ bundle exec rails webpacker:install:typescript $ yarn add @types/react @types/react-dom
Which added to webpacker.yml extensions:
- .tsx - .ts
And added to presets of babel.config.js
['@babel/preset-typescript', { 'allExtensions': true, 'isTSX': true }]
As well as various dependencies to package.json
package.json
I actually ran the install task before upgrading to 5.4.3 from 4.0.7.
I reversed everything, upgraded webpacker to to 5.4.3, ran the install task, and it's working now.
Ruby version: 3.1.2 Rails version: 6.1.6.1 Webpacker version: 5.4.3
Expected behavior: Compile
app/javascript/internal/components/Events/index.tsx
Actual behavior:
I ran:
Which added to webpacker.yml extensions:
And added to presets of babel.config.js
As well as various dependencies to
package.json