question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vite related issue

See original GitHub issue

Reproduction

Steps to reproduce the issue:

  1. Create any vite app
  2. Install and import library import '@papyrs/stylo'

Error in terminal:

381|  var ce = (e2) => {
382|    const t2 = e2.h.replace(/-/g, "_"), n2 = e2.q, l2 = ie.get(n2);
383|    return l2 ? l2[t2] : import(`./${n2}.entry.js`).then((e3) => (ie.set(n2, e3), e3[t2]), oe);
   |                                ^
384|  };
385|  var re = /* @__PURE__ */ new Map();
The above dynamic import cannot be analyzed by vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats.
If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

  Plugin: vite:import-analysis
  File: /test-project/node_modules/.vite/@papyrs_stylo.js?v=ac2d9e89

Error in browser console:

Screen Shot 2022-02-10 at 10 41 16 AM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
peterpeterparkercommented, Feb 10, 2022

I needed a coffee, I think it works as following:

import { defineCustomElements } from '@papyrs/stylo/dist/components/stylo-editor';
defineCustomElements();

However doing so it won’t work without installing in addition @stencil/core as a dependency.

There are several issues open at Ionic and Stencil about it. Until these are solved there is no cleaner way to import it in vite projects I think.

https://github.com/ionic-team/ionic-framework/issues/23823

https://github.com/ionic-team/stencil/issues/2826

https://github.com/ionic-team/stencil/pull/2959

0reactions
peterpeterparkercommented, Sep 4, 2022

This has been solved thanks to an improvement in StencilJS and released in v0.0.38

See https://github.com/papyrs/stylo/releases/tag/v0.0.38

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · vitejs/vite - GitHub
Issues list ; Respect Browserslist config in esbuild · #11489 opened · ai ; support preload and prefetch of css · #11486 opened...
Read more >
Troubleshooting - Vite
Requests are stalled forever #. If you are using Linux, file descriptor limits and inotify limits may be causing the issue. As Vite...
Read more >
Common Issues - Nuxt Vite
Vite has an issue for pre-bundling dependencies with named exports (#56 ). ... Related to #7 , errors can happen while importing assets...
Read more >
Problem with Vue3 Vite .env during development mode
VITE_SOME_KEY);. It's working after build and serve. But during development (npm run vite) i have problem: Module "process" has been ...
Read more >
Troubleshooting | Vite Ruby
... and bugs introduced in the past. Please skim through before opening an issue. ... See above, it could be related to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found