710 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
82
views
I am having trouble using import and export keyword in webpack
This is the module's code from sum.js
function sum(a, b) {
return a + b;
}
export default sum;
And this is my entry point script index.js
import sum from './sum.js';
const add = sum(2, 4);
...
0
votes
0
answers
38
views
Creating files in a sibling directory
I'm in a situation where I want to create "dist" files along a dynamic path but in a specific child directory, which is a sibling to the source directory.
My project structure ideally looks ...
0
votes
0
answers
36
views
HTML (.jsx?) syntax in a express.js file throws SyntaxError: Unexpected token '<' when using node
I've started a mern-skeleton using Vite and Node. I'm using yarn as my package manager as to not have to use webpack. I'm pretty sure I have the necessary Babel dependencies installed.
Everything ...
1
vote
0
answers
40
views
webpack doesn't work when migrating files from .jsx to .tsx
after setup TypeScript for a React project I encountered a problem with webpack-dev-server's hot reload while migrating .jsx files. Whenever i take an existing .jsx file and change the name ending to ....
1
vote
1
answer
120
views
Parsing error after installing and importing mui
On my react app (which is installed with create react app) I installed mui and imported tooltip.
I'm facing this error and couldn't find absolutely anything in a net.
Module parse failed: Unexpected ...
0
votes
1
answer
71
views
React-scripts token error on yarn start in 5 year old project — works on other machines
I’m encountering an issue with a 5 yeas old React project where react-scripts is unable to identify tokens, leading to an error. The project runs perfectly fine on the production server and other ...
0
votes
0
answers
121
views
Doesn't swc-loader have class support?
I'm migrating an old React codebase from Webpack to rspack for better performance. In the migration, I'm changing the loader from Bable to swc-loader. But the swc-loader throws an error on handling ...
1
vote
1
answer
204
views
Fields with the 'declare' modifier cannot be initialized here, but only in the constructor
I don't even know where to begin or what to look for with this one.
I'm upgrading an old React, Node, Express full-stack application, and one of the steps I'm taking is adding TypeScript. The project ...
2
votes
0
answers
65
views
Module parse failed: Unexpected token in react-idle-timer with React Scripts
I’m encountering an error when trying to compile my React project that uses the react-idle-timer package. The error points to an unexpected token in index.esm.js of react-idle-timer, specifically on ...
0
votes
1
answer
344
views
How can I correctly import an MDX file in React using @mdx-js/react?
I'm trying to import an MDX file in my React project using the @mdx-js/react library, but I'm encountering issues with incorrect import paths.
When trying to import Content.mdx, the resulting path is ...
0
votes
1
answer
118
views
Setting Up Webpack for a React Project
Setting Up Webpack for a React Project - Need Help with Error
I'm in the process of setting up Webpack for my React project using npm, but I'm encountering an error that I can't seem to resolve. I ...
1
vote
1
answer
78
views
Module build failed (from ../../react/node_modules/babel-loader/lib/index.js)
I am trying to run react code that renders tic-tak-to but I get the error "Module build failed" and "SyntaxError". I have looked for possible solutions but didn't find anything ...
0
votes
1
answer
148
views
How does AST traversal with Babel affect source maps even when no changes are made?
I have a custom Webpack loader where I'm traversing through the AST of the code using Babel to change the import name of a module. However, it seems like this is affecting the source maps of modules, ...
1
vote
1
answer
82
views
Webpack configuration not working for jsx file with babel lorder
When runing the react project which is configured with webpack and babel loder is giving and error saying unexpected token in jsx files.Please find bellow error snippit
ERROR in ./src/index.js 10:12
...
1
vote
0
answers
201
views
default export - is not a function
I'm currently working in a legacy project that's built using CommonJS. But because I needed to use react-pdf to create PDF files, I had to add .mjs files to my project.
This works fine on the dev ...