Comments (6)
We have solved the issue in private chat.
For record, this looks like a rare issue in MS Edge browser when executing babel transpiled commonjs code (from ESM).
The fa pro packages have tons of exports in the index.es.js, which cli-bundler (and also dumber) uses babel to transpile to commonjs. The transpiled code has some huge assignment chain like this:
...
exports.faAlien=exports.faAlicorn=exports.faAlbumCollection=exports.faAlbum=exports.faAlarmSnooze=exports.faAlarmPlus=exports.faAlarmExclamation=exports.faAlarmClock=exports.faAirFreshener=exports.faAirConditioner=exports.faAdjust=exports.faAddressCard=exports.faAddressBook=exports.faAd=exports.faAcorn=exports.faAbacus=void 0;
MS Edge seems having problem to execute such JavaScript.
The work around is to use explicit "main" file override in cli-bundler aurelia.json config to bypass the index.es.js
. Those fa pro packages' UMD build index.js
has no such huge assignment chain issue (guess fa uses something like Rollup to build the UMD file).
"dependencies: [
...
{
"name": "@fortawesome/pro-solid-svg-icons",
"main": "index.js"
}
]
from cli.
My old license of fa5 is expired. Is it possible for you to zip all node_modules folder?
One possible cause might be there is some circular dependency in some fa pro js code, requirejs cannot handle that properly at runtime.
The replacement of cli-bundler, called dumber (we use dumber in Aurelia 2 skeleton now), can handle circular dependency in CommonJS and ESM. You might try that, there is an Aurelia 1 skeleton provided by dumber.
from cli.
I'm not sure the issue is due to requireJS, as we are using this combo in other projects as well without issues. When Downgrading FontAwesome, the issue persists, so I'm quite certain this must be some build issue resulting in a faulty bundle.
Anyway, I managed to reproduce the issue using dumber, with FontAwesome Free, getting the same stack size exception:
my-app.zip
from cli.
This is very strange, I am running your dumber app without any problem (only needed to remove pro packages from package.json). Node v14.17.0 on macOS. No error in terminal and browser console.
Saw a warning from Babel, but it's unlikely to be related.
[dumber] 1.2.36 @fortawesome/fontawesome-svg-core
[dumber] 5.15.4 @fortawesome/free-solid-svg-icons
[BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
You problem might only exists in pro packages. If you were running watch mode, and modified your code to import free packages only, the bundle file in browser side still contains previously traced pro packages. Watch mode doesn't remove package from bundle, only adds new ones.
from cli.
You problem might only exists in pro packages. If you were running watch mode, and modified your code to import free packages only, the bundle file in browser side still contains previously traced pro packages. Watch mode doesn't remove package from bundle, only adds new ones.
It seems you are correct, after a full rebuild I can't reproduce the issue with the free icon set :(
I'll contact you on discord to send my full project, as I'm not sure how permissive the FA license is for sharing stuff like this..
from cli.
Update: not Edge issue.
It only affects Edge on macOS, but all browsers (Chrome/Edge/Firefox) on Win10 or Win11.
from cli.
Related Issues (20)
- Updating CopyWebpackPlugin (> 6.0.0) breaking changes
- updating css-loader causing errors HOT 4
- Importing the 'aurelia-router' into an ApiInterceptor Breaks Application HOT 5
- au new --here fails to scaffold project HOT 19
- Todo: fall back gracefully for missing main file in npm package HOT 1
- Dependencies for array.prototype.filter and available-typed-arrays need updating HOT 5
- Error on execution 'au twx-run' from aurelia proj HOT 3
- npm start fails with TypeError: Cannot read properties of undefined (reading 'loader') HOT 4
- bundles are not loaded for pushState HOT 1
- Cannot perform production build on Windows HOT 1
- Freshly created app (TypeScript or ESNext) fails to start HOT 12
- The export keyword can only be used with the module goal HOT 4
- PackageAnalyzer and Bundler incorrectly identifying plugin/ts references as npm packages HOT 4
- Why is crypto-browserify dependency of aurelia cli?
- Property 'configure' does not exist on type 'typeof import("C:/Users/Dilan/Desktop/qwasar/my_yelp/node_modules/aws-amplify/lib-esm/index")'. HOT 3
- How to enable cancellation correctly?
- Latest enquirer release seems to break 'au build' with 'SyntaxError: Unexpected token =' HOT 3
- built-in bundler cannot process .mjs third party files HOT 6
- `au run` fails with latest node.js update for Windows HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.