Sip.js: Grammar Identifier error after update to v0.8

Created on 17 Oct 2017  ·  3Comments  ·  Source: onsip/SIP.js

I just tried to update sip.js from 0.7.8 to 0.8.1 using npm in my Ionic3/Angular4 project and I get this error.

Uncaught Error: Module parse failed: C:\xxxxxx\node_modules\sip.js\src\Grammar\src\Grammar.pegjs Identifier directly after number (14:14)
You may need an appropriate loader to handle this file type.
| DIGIT = [0-9]
| ALPHA = [a-zA-Z]
| HEXDIG = [0-9a-fA-F]
| WSP = SP / HTAB
| OCTET = [\u0000-\u00FF]

Uninstall/reinstall yields same result. Knock it back down to 0.7.8 and it works just fine. The same grammar file that won't parse is in both versions so I'm not sure where to go from here.

Any help is appreciated.

bug

Most helpful comment

I was able to replicate and then fix by changing main in package.json. We'll get this in the next release, which should occur at the latest next week. I'll close the issue when that releases.

All 3 comments

The problem is that webpack is attempting to build within the sip.js folder, which is unnecessary. I can look into making sure that doesn't happen (it shouldn't), but in the meantime you should be able to add a line within your js loader in your webpack config, like:

test: /\.js$/,
exclude: /node_modules\/sip.js/,

Which should prevent webpack from attempting to build within the folder. I'll take a look at this tomorrow, I would expect it is a small change to our package.json, but we'll see.

I was able to replicate and then fix by changing main in package.json. We'll get this in the next release, which should occur at the latest next week. I'll close the issue when that releases.

We have released 0.8.3 which addresses this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raphaelhovsepyan picture raphaelhovsepyan  ·  6Comments

i-kitchen picture i-kitchen  ·  8Comments

seanbright picture seanbright  ·  3Comments

josephfrazier picture josephfrazier  ·  26Comments

diegoteixeir4 picture diegoteixeir4  ·  5Comments