DEV Community

Discussion on: Web Components: from zero to hero

Collapse
 
lorless profile image
Lorless

Hi Pascal,

It seems the examples of the code running in stackblitz have no reference to index.js. It is never included in the page. How is the custom element code even running? The only script links are to node_modules.

Collapse
 
thepassle profile image
Pascal Schilp

Hey Lorless, stackblitz does some magic that adds the index.js. If you're trying it out locally you should add a <script type="module" src="./index.js"> to your index.html.

Collapse
 
tiho2 profile image
tiho2 • Edited

I'd additionally install es-dev-server as explained here. In case local development environment is not already set.

Collapse
 
lorless profile image
Lorless • Edited

Thanks! I wondered whether something like that was happening. The tutorial was good.