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.

Error When Compiling Contracts

See original GitHub issue

Issue

I type this command in the directory of my contract: truffle compile

And I get this error:

C:\Users\nick\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\cli.js:93
          let removedInfo = new RegExp(identifyingInfo, "g");
^
SyntaxError: Invalid regular expression: /C:\Users\nick\AppData\Roaming\npm\node_modules\/: \ at end of pattern
    at new RegExp (<anonymous>)
    at Object.<anonymous> (C:\Users\nick\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\cli.js:93:1)
    at cb (util.js:353:39)
    at callbackifyOnRejected (util.js:337:10)
    at process._tickCallback (internal/process/next_tick.js:63:19)

What do I do to fix this?

Expected Behavior

I expect the command to compile my contracts.

Environment

Truffle v5.0.7 (core: 5.0.7) Solidity - 0.5.5 (solc-js) Node v10.15.3

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
fainashaltscommented, Mar 11, 2019

@PizBernina @mudgen I have fixed this, it should be live in our next release. @mudgen’s fix should take care of it in the short term. Thank you for bringing this to our attention!

@PizBernina, the reason you saw this happen in a different command is because the regex error only throws inside of another error. So you likely had an error in your migration somewhere. Once the regex is fixed you’ll be able to see what the actual error was.

2reactions
fainashaltscommented, Mar 13, 2019

This issue is fixed as of v5.0.8. Closing, thank you for finding and reporting it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors when compiling smart contracts with Truffle and solc-js
This post has to do with troubleshooting Truffle and solc-js errors using npm. The first issue I encountered involved an error regarding an...
Read more >
Parsing error when compiling with Solidity - Stack Overflow
I'm trying to compile 2 chainlink references ...
Read more >
Compiling contract raises strange error from solc but ... - GitHub
It stems from a limitation of the EVM (only 16 stack slots are reachable at any given time) and working around it requires...
Read more >
solidity - Error when compiling - Ethereum Stack Exchange
I'm using the latest version of Truffle. When I try to compile my contract I get this error.
Read more >
Compiling Contracts — Brownie v1.3.1 documentation
When doing so, you may encounter compiler errors when a contract imports another contract that is meant to compile on a higher version....
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