You may need an appropriate loader to handle this file type with Webpack and Babel
You need to install the es2015
preset:
npm install babel-preset-es2015
and then configure babel-loader
:
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
}
How to fix You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
This issue occurs when you have fewer configurations than what you want to use.
In your case, you are trying to use Typescript on your NextJS project. Unfortunately, your Webpack configuration doesn't have a Typescript file loader.
There are two ways to solve this issue:
- Use NextJS Typescript project start example from here
- Add TS file loader on your Webpack configuration (reference in here)
Typescript with Webpack - You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file
So I think your issue here is that your webpack config file is written in typescript. I think your webpack config itself looks okay, but basically your webpack file is telling your system how to handle typescript files, but nothing is telling your system how to handle a webpack.config.ts file.
One quick test would be to remove the small bit of typescript in your config file and change it to webpack.config.js and see if that works. Then at least you've confirmed the issue.
As for getting the typescript config file you might just need to install ts-node
as an npm dev dependency.
Here is the documentation for using a typescript config file though https://webpack.js.org/configuration/configuration-languages/
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
under your modules section, you need to add a handler for png files. Maybe file-loader? https://www.npmjs.com/package/file-loader
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
You are using unnecessary escape character: which is not required.
Replace test: '/\.(js|jsx)$/',
with test: /\.js$|jsx/,
it should work fine.
I replicated your issue in my machine and found the same which is resolved by the above fix.
hope this helps, happy coding!!!
NextJs project dependency - You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file
I found that I can't share components like this.
I need to do a component library ( how can I share components in two projects in NextJs?)
Related Topics
Styling Qml Without Manually Marking Each Property to Be Styled
What Does This Size Mean in CSS {Font: 14Px/24Px Arial, Helvetica, Sans-Serif}
Using Nth-Child in Tables Tr Td
Svg @Font-Face Works in Svg But Not When Included in a Page
Do I Need to Generate a CSS File from Pygments for My Jekyll Blog, to Enable Colorful Code Snippet
Add Syntax Highlighting to .Less-Files in Netbeans
HTML Special Characters in CSS "Content" Attribute
CSS Animation with Time Interval
Bootstrap 3 Navbar Active Li Not Changing Background-Color
How to Change the Font Size with SASS in Bootstrap 4
How to Exclude a Tag from CSS Class
Changing the Order of Grid Item Stacking in Material-Ui
Change Justify-Content Value When Flex Items Overflow Container
Change Arrow Style for Default Expansion Panel Arrow