Truffle: Firefox compatibility

Created on 21 May 2020  路  2Comments  路  Source: trufflesuite/truffle

Issue

Using @truffle/contract v4.2.5 breaks the app on Firefox.
The console throws SintaxError: invalid regexp group error.
It looks like there is a regex used that is not supported on Firefox yet (https://caniuse.com/#feat=js-regexp-lookbehind).

Steps to Reproduce

  "dependencies": {
    "@truffle/contract": "^4.2.5",
    "@truffle/debug-utils": "^4.1.3",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "3.4.1",
    "typescript": "^3.9.3",
    "web3": "^1.2.7"
  },

const contract = require('@truffle/contract')

Expected Behavior

Should work as in Chrome browser for example.

Actual Results

The app breaks and fails to render on Firefox browser.
Console error:
SyntaxError: invalid regexp group

Screen Shot 2020-05-21 at 11 21 41

Environment

  • Operating System: OSX Catalina
  • Ethereum client: web3 v1.2.7
  • node version (node --version): v10.20.1
  • npm version (npm --version): v6.14.4

Most helpful comment

Ah, nevermind, I think I found it; it's coming from a regexp in @truffle/codec which is imported by @truffle/debug-utils. Ugh. OK, will have to figure out an appropriate way to handle this.

All 2 comments

Yikes, thanks for reporting this! Do you by any chance know what version the problem started on? I'm having a hard time finding the problem. I think it's in a dependency; chunk.js doesn't appear to be one of our files.

Ah, nevermind, I think I found it; it's coming from a regexp in @truffle/codec which is imported by @truffle/debug-utils. Ugh. OK, will have to figure out an appropriate way to handle this.

Was this page helpful?
0 / 5 - 0 ratings