teodosii / react-notifications-component

Delightful and highly customisable React Component to notify your users
https://teodosii.github.io/react-notifications-component/
MIT License
1.27k stars 73 forks source link

Error: You may need an appropriate loader to handle this file type #136

Closed itsmichaeldiego closed 2 years ago

itsmichaeldiego commented 2 years ago

I upgraded the version from 3.2.6 to 3.3.2 and I am getting the following error when building:

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.

My loaders exclude ./node_modules which makes sense, but I enabled it just to see what was the underlying issue, and when enabling the loaders I get:

Support for the experimental syntax 'classProperties' isn't currently enabled

I don't think I should add an extra loader just to compile the library as i've no other problems with the rest of the libraries I use. Am I missing something or is it a problem with the library? Any idea?

teodosii commented 2 years ago

Is it showing this error when importing the library or just for a specific code run? This was changed to use webpack 5, in the CRA project it doesn't complain about that.

itsmichaeldiego commented 2 years ago

@teodosii This error happens at build time, I think you must have used a major version change if you changed to webpack 5 and also if you introduced some breaking changes too. Our package manager (yarn), upgraded this automatically and broke our production build, I had to fix the version to 3.1.0 to avoid the error.

teodosii commented 2 years ago

Try 3.3.11, my guess was that the outputed code was not being passed through babel, only outputed by TypeScript, therefore you run into experimental syntax issue.

@itsmichaeldiego is 3.3.11 good for you now? I'm using CRA, not sure if this syntax is enabled by default, but it's pretty standard these days...

itsmichaeldiego commented 2 years ago

@teodosii When trying 3.3.11 I can confirm that the error is not happening anymore, but I get another error:

> Build error occurred
ReferenceError: self is not defined
    at Object.<anonymous> (/Users/michaeldiego/Workspace/theluupe/webapp/node_modules/react-notifications-component/dist/index.js:1:292)

I think its the same that happens in the issue #135