-
Notifications
You must be signed in to change notification settings - Fork 532
ESM with Importmaps #990
Comments
Can you polyfill |
Just tried it in my app and in the code pen. No change, unless I am doing it wrong. |
The polyfill will need to be added before all of your scripts; placing it in |
Ok, that works, https://coder2000.github.io/. Codepen it seems doesn't like to do importmaps. |
I'm one of those Rails 7 developers and hit this error |
+1 for proper support/documentation here. Rails 7 introduced importmaps by default, and I must say - it is pretty awesome to not have to deal with a build environment. You may want to consider adding some information to the documentation on how one might use Tippy using importmaps, as more people may start adopting it as time goes on. |
Seconded @gregblass - I just spent an hour trying to make tippy work on a new Rails 7 app only to end up here. |
same here for tippyjs |
The polyfill, while it can make it work, is not really adequate. I'm coming here because tippy is a transitive dependency and for a library to require a global setting like this is not a good practice. Could the code be updated to check for
|
Sorry I know this is annoying :\ Any type of guard like that always seemed to break the dead code elimination by bundlers when I checked (defeating the purpose of the check), which causes the warning messages to end up in production bundles inflating the size. |
Defining |
It would be great to use this library via importmap out of the box, I agree that defining the process object seems too hacky IMHO |
Any updates on this? @atomiks would a PR on this be considered? |
@atomiks can we help in any way? Following the last comment: would a PR on this be considered? Thanks! |
Bug description
I know importmaps aren't on most peoples horizon but it is coming up quick with Rails developers and the release of Rails 7. Currently tippy requires a build environment like webpack, rollup or esbuild however with importmaps you just include the final ESM build from a CDN so there is no build step.
When I try to use tippy in this fashion it fails with
Uncaught ReferenceError: process is not defined
.Reproduction
As I can't include the ESM shims this pen will only work on Chromium based browsers. The error will be visible in the browser console not the codepen for some reason.
https://codepen.io/coder2000/pen/mdMRgLL
The text was updated successfully, but these errors were encountered: