Comments (5)
Hello,
Materialize-docs is an example of using materialize from a vite project. Can you provide an example project to test this issue?
Thanks!
from materialize.
@danice i made i git repository: https://github.com/axelf/materialize-vite
You can downlaod the code and after a npm install
and npm run dev
you see the error:
from materialize.
This is working: import { M } from "@materializecss/materialize/dist/js/materialize.js";
This is the path of the main entry of the package json.
But why isimport { M } from "@materializecss/materialize";
not working?
It is working, but this says the editor if i hover over the import statement:
Could not find a declaration file for module '@materializecss/materialize/dist/js/materialize.js'. '/myproject/node_modules/@materializecss/materialize/dist/js/materialize.js' implicitly has an 'any' type. If the '@materializecss/materialize' package actually exposes this module, try adding a new declaration (.d.ts) file containing
declare module '@materializecss/materialize/dist/js/materialize.js';ts(7016) module "/myproject/node_modules/@materializecss/materialize/dist/js/materialize"
from materialize.
it's because the package has also this entry that takes preference in the import:
"module": "src/index.ts",
This "module" was not causing problems when importing the library using webpack and it make it work when using it as a workspace (as in materialize-docs).
I think we should replace "src/index.ts" here by the ".d.ts" that your comment says. But we should check that it keeps the library working when used from webpack and as a workspace.
from materialize.
@danice thank you for helping me out.
For now should i leave the import as it is import { M } from "@materializecss/materialize/dist/js/materialize.js
and ignore the error in my code editor? I don't mind the marking in the editor and it works like this for now
from materialize.
Related Issues (20)
- [Bug]: Materialize Select auto scroll to top on Safari HOT 2
- [Bug]: Collapsible looks/behaviour changed in version 2.0.3 HOT 1
- .show-on-medium-and-up vs .hide-on-med-and-up HOT 1
- [Bug]: Autocomplete issues HOT 1
- [Bug]: Clicking on a dropdown trigger twice+ times consecutively causes unexpected results HOT 6
- Creating Components via JavaScript HOT 4
- [Bug]: Dropdown + Window Resize
- Microsoft Defender Antivirus detects "Trojan:Script/Wacatac.H!ml" HOT 8
- [Bug]: Select Options does not overflow cards
- [Bug]: Range input appearance not work on chrome 123, but work on Firefox
- [Bug]: TimePicker is completely broken
- [Bug]: Modal with Fixed Footer Always has Scrollbar HOT 1
- [Bug]: Tonal button seems not presenting HOT 1
- [Bug]: Autocomplete selectOption does nothing HOT 2
- Add "RAIL" material 3 HOT 3
- Marquee Component HOT 1
- Create Theme v2.1.0 HOT 6
- [Bug]: scrollbar appears with modal in 2.1.0 HOT 3
- [Bug]: Feature Discovery animation no longer works in 2.1.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from materialize.