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

Webpack Compilation Error #29407

Open
githubakarsh opened this issue Apr 25, 2024 · 2 comments
Open

Webpack Compilation Error #29407

githubakarsh opened this issue Apr 25, 2024 · 2 comments
Labels
stage: needs information Not enough info to reproduce the issue

Comments

@githubakarsh
Copy link

githubakarsh commented Apr 25, 2024

Current behavior

When I import redux store and use a dispatch function. I am getting :

Webpack Compilation Error Module parse failed: Unexpected token (1:0) You may need appropriate loader to handle this file type, currently no loaders are configured to process this file. Se .... <Svg ..... />

Note :
We are using file-loader and svg-inline-loader to handle SVG in webpack5

Its bit weird, when I import Store and Slice file to dispatch am getting SVG related compilation error. If I remove the import , there is no compilation error. I am stuck and can't dispatch to the slice of react-redux.

Desired behavior

Test case should be run with out any failure

Test code to reproduce

I cannot add the code here since its a private repo

Cypress Version

13.8.0

Node version

18.18.0

Operating System

windows

Debug Logs

Webpack Compilation Error Module parse failed: Unexpected token (1:0) You may need appropriate loader to handle this file type, currently no loaders are configured to process this file. Se .... <Svg ..... />

Other

We are using file-loader and svg-inline-loader to handle SVG in webpack5

@jennifer-shehane
Copy link
Member

I don't think there will be much to go on here without some code or some way to reproduce.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Apr 25, 2024
@githubakarsh
Copy link
Author

@jennifer-shehane , the code is not public, we cannot share the code here.

The error code :

Webpack Compilation Error Module parse failed: Unexpected token (1:0) You may need appropriate loader to handle this file type, currently no loaders are configured to process this file. Se .... <Svg ..... />

The above are the debug logs when we are trying to import the reducer slice in cypress files .
Example :

File name : component.test.cy.js

import { componentSlice } from ''../slices;

error when importing :
Webpack Compilation Error Module parse failed: Unexpected token (1:0) You may need appropriate loader to handle this file type, currently no loaders are configured to process this file. Se .... <Svg ..... />

We use : file-loader and svg-inline-loader in webpack
and we don't use svg's in reducer files and hence forth we expect we should not be getting the above error when we use
"npx cypress open"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue
Projects
None yet
Development

No branches or pull requests

2 participants