Giter Site home page Giter Site logo

Comments (6)

3cp avatar 3cp commented on August 14, 2024 1

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.

3cp avatar 3cp commented on August 14, 2024

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.

arnederuwe avatar arnederuwe commented on August 14, 2024

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.

3cp avatar 3cp commented on August 14, 2024

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.

arnederuwe avatar arnederuwe commented on August 14, 2024

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.

3cp avatar 3cp commented on August 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.