0

How should I define an import section inside my WebComponent with polymer 3.

Currenty I have:

import {html, PolymerElement} from '@polymer/polymer/polymer-element.js';

and my catalogs structure looks like: catalogs structure

and I'm getting an error: (index):7 GET http://127.0.0.1:8001/components/ing-dr-plan-details/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js 404 (Not Found)

Piotr Treska
  • 63
  • 1
  • 5

2 Answers2

0

Its not 100% clear where you've placed your polymer config, but I assume you have everything within the folder my-web-component. I.e also your node modules should be within that folder see also doc.

cuda12
  • 600
  • 3
  • 15
0

The import code you have

import {html, PolymerElement} from '@polymer/polymer/polymer-element.js';

and the error does not relate to each other, the terminal is complaining about the missing @webcomponentsjs package.

This is due to the fact that in Polymer 3, @webcomponentsjs package is not included by default in dependencies anymore (it used to be in Polymer 2). You need to manually install @webcomponentsjs with:

npm install @webcomponentsjs

Binh Bui
  • 343
  • 1
  • 8