-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
[Bug]: Release 2.0.0-alpha module does not load in webpack projects #364
Comments
To test that the new version works with the webpack example project do the following:
|
Ok sweet! I got it to run locally 👍
Yes! This is awesome, we should aim for this next. My VSCode said it needs some type definitions for Materialize... I will check if they are found automatically if implemented, or if the need to be compiled seperately (d.ts file?) somehow via webpack... |
fix: library does not load in webpack projects #364
I just upgraded to 2.0.1-alpha but I still have the issue : |
I have created a very simple project to proof build materialize components with webpack. Can you provide some example project with materialize not loading? |
Well, i fixed half of my issue.
If I change import with this import, it works now : But I still have an issue with some JS code embedded at the end of my main html :
Maybe M was a global variable in previous versions and now has to be imported with dedicated import ? |
I think you should include the code in this last element script in your script.js. |
Before submitting...
Context
updating the materializecss library in an existing typescript-webpack project does not load module "M" needed to initialise components.
A similar situation seems to be affecting other users.
Current Behavior
Installing the library as an npm package and trying to import it with
import M from '@materializecss/materialize';
lets M undefined.
Expected behavior
It should have the M class exported in the global.ts.
Possible Solutions or Causes
It should be some problem with the configuration of the webpack module.
I have a test project (see "Steps to reproduce"). In that project loading some other simple typescript modules work so I'm doing proofs to found where is the problem with materialize project.
Also this project could help to add typescript interfaces definitions for the library (this could be a separate issue).
Steps to reproduce
I have created a webpack version of the materialize documentation to reproduce the issue
https://github.com/danice/materialize-docs-webpack
npm install
npm run build
Your Environment
The text was updated successfully, but these errors were encountered: