Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

61
Views
Failed to resolve module of Polymer 3 in Electron v.17 application

I get electron-quick-start and electron-polymer from fluidnext to use for my Polymer 3 application.

When i try to import my webcomponents to the project, i have got this error: Uncaught TypeError: Failed to resolve module specifier "@polymer/polymer/polymer-element.js". Relative references must start with either "/", "./", or "../". to solve this i used ../node_modules/my-folder/my-component.js but this only worked when i import a component who has only references to his default folder.

Example: 

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

This have worked for me, this component shows in my Electron Application, but i have a lot of others components who use other references, like this below.

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

// import { sharedStyles } from './shared-styles.js';

import '../node_modules/@polymer/paper-input/paper-input.js';
import '../node_modules/@polymer/iron-icon/iron-icon.js';
import '../node_modules/@polymer/iron-icons/iron-icons.js';

When i import this component i got this error, similar to the first: Uncaught TypeError: Failed to resolve module specifier "@polymer/polymer/polymer-legacy.js". Relative references must start with either "/", "./", or "../".

And that is my problem now, every new component i need to add ../node_modules before the default polymer import and when this component has others imports inside i got other errors to the references.

How can i solve this?

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs