Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Failed to resolve module specifier "lit-element". ¿How can I solve this in Rollup?

I'm practicing Rollup and I'm trying to import 'lit-element' to create an SPA. I can build the application but when I access to the page in localhost (deployed with VSCode plugin) in the console I can see this error:

Uncaught (in promise) TypeError: Failed to resolve module specifier "lit-element". Relative references must start with either "/", "./", or "../".

This is the configuration of my rollup.config.json

const config = {
    input: ['src/components/shop-app.js', 'src/components/**/*.js', 'src/controller/**/*.js',
        'src/controller/*.js'],
    output: {
        dir: `build-modern/src/`,
        format: 'es'
    },
    plugins: [
        alias({
            entries: [
                { find: '@Controller', replacement: './controller' },
                { find: '@Components', replacement: './components' },
                { find: '@Utilities', replacement: './utilities' },
                { find: '@Modules', replacement: './node_modules' }
            ]
        }),
        multi(),
        babel(babelConfig),
        minifyHTML(),
        copy(copyConfig),
        commonjs({
            namedExports: {
                'node_modules/@babel/runtime/regenerator/index.js': ['isValidElementType'],
            }
        }),
        nodeResolve(),
        resolve(),
        replace({
            // Recogemos el valor y lo convertimos
            ENV: JSON.stringify(process.env.NODE_ENV || 'development')
        }),
        scss()
    ],
    preserveEntrySignatures: false,
}

And I import 'lit-element' like this:

import { css } from 'lit-element';

I hope this will be enough information about the problem but if you need more code or information please, ask me :)

Thank you all!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!