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.

Include floating-ui as dependency isn't working?

See original GitHub issue

I’m trying to include your script into a library and it won’t work.

I’m getting

Uncaught (in promise) ReferenceError: process is not defined

Here’s how my code looks like. This sandbox works fine, but not in my compiled ES6 code it doesn’t.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
atomikscommented, Jan 2, 2022

Here’s our Rollup setup to replace __DEV__, but you’d use a direct check for process.env.NODE_ENV

https://github.com/floating-ui/floating-ui/blob/648b5bd7e4b614c2a40d5f2e678363ec5225ab9a/packages/core/rollup.config.js#L60-L65

i.e.(ensuring you’re processing node_modules):

replace({
  'process.env.NODE_ENV': `"production"`
});

The other suggestion to import directly from @floating-ui/dom/dist/floating-ui.dom.esm.min.js doesn’t work.

What error is there?

0reactions
atomikscommented, Jan 2, 2022

Ah yeah because @floating-ui/dom’s minified version doesn’t point to /core’s minified version. Would probably need an alias plugin in that case, but this is a better way to handle it anyway

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mistake in docs regarding Bootstrap's usage of floating-ui #1718
As a user, I am currently using bootstrap. I see this comment and I think "great, I can use floating-ui without bringing in...
Read more >
Migrating from Popper 2 to Floating UI
First thing's first, uninstall @popperjs/core and install @floating-ui/dom . npm uninstall @popperjs/core npm install @floating-ui/dom. Positioning ...
Read more >
why doesn't placement of floating-ui work? - Stack Overflow
I guess the computePosition method is not configured properly moreover I haven't found any example for vanilla js floating-ui til now. PS: I...
Read more >
Floating Content - OutSystems 11 Documentation
If the UI widget doesn't display, it's because the dependency isn't added. This happens because the Remove unused references setting is enabled.
Read more >
FloatingActionButton class - material library - Dart API
A floating action button is a circular icon button that hovers over content to promote a primary action in the application. Floating action...
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