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

no loaders are configured #3

Open
himansh-gjr opened this issue Apr 8, 2021 · 1 comment
Open

no loaders are configured #3

himansh-gjr opened this issue Apr 8, 2021 · 1 comment

Comments

@himansh-gjr
Copy link

**I am trying to use this package but I am getting this error can't find way to resolve this, can somebody help to fix this **

Screenshot 2021-04-09 at 5 10 30 AM

@hS71Ru
Copy link

hS71Ru commented Oct 23, 2023

It seems to be related to JSX syntax inside a JavaScript file. To fix this, make sure to have the appropriate loaders set up in webpack configuration to handle JSX files.

In webpack configuration, should have a rule for processing JavaScript files with a loader like Babel to preprocessor JSX syntax.

webpack.config.js might like:

module.exports = {
// ... other webpack config options
module: {
rules: [
{
test: /.js$/, // This rule will match .js files
exclude: /node_modules/,
use: {
loader: 'babel-loader', // Use Babel to transpile JavaScript
options: {
presets: ['@babel/preset-env', '@babel/preset-react'], // Add the React preset
},

},
},
],
},
};

Ensure the necessary dependencies installed, like babel-loader and the presets & may need to adjust your webpack configuration to suit your project structure and requirements.

After configuring this, webpack should be able to handle JSX syntax in JavaScript files without encountering the "Unexpected token" error.

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

No branches or pull requests

2 participants