Using app.import for browser-only packages
See original GitHub issueAt the minute, it doesn’t look like I can conditionally use app.import
based on whether I’m building for the FastBoot build, or the browser build.
I’m trying to import a bower package that I’m only utilising inside didInsertElement
.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to Import Browser Only Libraries Into Your Next.js ...
In this video we'll learn how to import browser only libraries into your Next.js apps. React has traditionally been a SPA framework that ......
Read more >Importing a Browser Only Package Into Next.js - Ahmed Faaid
How to import a package that only works in the browser into Next.js ... We will create an app using create-next-app which will...
Read more >Conditional import for browser-only dependencies #2035
Hello, I'm having an issue when trying to build a Gatsby app using amCharts. Minimal repro here. The issue appears to be caused...
Read more >Docusaurus Client API
import BrowserOnly from '@docusaurus/BrowserOnly'; ... Returns true when the React app has successfully hydrated in the browser. caution.
Read more >Module Constraints - Remix
A module side effect is code that executes by simply importing a module · You need to avoid any browser-only module side effects...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve tried doing a conditional check against
process.env.EMBER_CLI_FASTBOOT
, but it appears that that applies for both the server-rendered app and the browser build. The app boots successfully, but on the client the JS starts throwing errors that the libraries do not exist.Unless I am building the app wrong? With a clean directory I’m running
ember fastboot --serve-assets
.Yes, the add on needs to be patched to conditionally call the import lines