Skip to content

Syntax error: invalid regular expressions #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
codytooker opened this issue May 4, 2019 · 12 comments
Closed

Syntax error: invalid regular expressions #13

codytooker opened this issue May 4, 2019 · 12 comments
Assignees

Comments

@codytooker
Copy link

When running the generator I get the following error in the console leading to not being able to run the generator.

 ERROR  SyntaxError: Invalid regular expression: /(?<fileName>[^(\s]+):[0-9]+:[0-9]+/: Invalid group

Seems to be related to a recent PR
#12

@jandever
Copy link

jandever commented May 8, 2019

+1

@jawa-the-hutt
Copy link
Collaborator

Can I get a rundown of what options were chosen when creating the Vue project initially as well as what options were chosen when adding the plugin? Are you using just the CLI or are you using the UI?

This will help me troubleshoot where this may be going wrong as I haven't been able to reproduce this yet with 3 different manual tests.

@jandever
Copy link

jandever commented May 8, 2019

I got the same error through the CLI as with the UI. Tried multiple different options (also all default) creating the Vue project and adding the plugin. Each time the error occurs.

C:\laragon\www\vue
λ vue create vue-cli

Vue CLI v3.7.0
? Please pick a preset: default (babel, eslint)

Vue CLI v3.7.0
✨ Creating project in C:\laragon\www\vue\vue-cli.
🗃 Initializing git repository...
⚙ Installing CLI plugins. This might take a while...

[email protected] install C:\laragon\www\vue\vue-cli\node_modules\yorkie
node bin/install.js

setting up Git hooks
done

added 1158 packages from 913 contributors and audited 23634 packages in 43.246s
found 0 vulnerabilities

🚀 Invoking generators...
📦 Installing additional dependencies...

added 36 packages from 27 contributors, updated 2 packages, moved 9 packages and audited 23923 packages in 13.011s
found 0 vulnerabilities

⚓ Running completion hooks...

📄 Generating README.md...

🎉 Successfully created project vue-cli.
👉 Get started with the following commands:

$ cd vue-cli
$ npm run serve

C:\laragon\www\vue
λ cd vue-cli

C:\laragon\www\vue\vue-cli (master)
λ vue add vue-cli-plugin-nativescript-vue

📦 Installing vue-cli-plugin-nativescript-vue...

  • [email protected]
    added 2 packages from 2 contributors and audited 24957 packages in 6.915s
    found 0 vulnerabilities

✔ Successfully installed plugin: vue-cli-plugin-nativescript-vue

? Enter a unique application identifier: org.nativescript.application
? Use HTML5 history mode? (Default: hash mode) No
? Is this a brand new project? (Default: Yes) Yes
? Dual Native AND Web development experience or a Native only? (Default: Dual) Dual Native AND Web
? What type of template do you want to start with? (Default: Simple) Simple
adding to package.json
deleting from package.json
doing template rendering

🚀 Invoking generator for vue-cli-plugin-nativescript-vue...
ERROR SyntaxError: Invalid regular expression: /(?[^(\s]+):[0-9]+:[0-9]+/: Invalid group
SyntaxError: Invalid regular expression: /(?[^(\s]+):[0-9]+:[0-9]+/: Invalid group
at module.exports.extractCallDir (C:\laragon\www\vue\vue-cli\node_modules\vue-cli-plugin-nativescript-vue\generator\index.js:907:22)
at module.exports.renderDirectoryStructure (C:\laragon\www\vue\vue-cli\node_modules\vue-cli-plugin-nativescript-vue\generator\index.js:847:27)
at api.render (C:\laragon\www\vue\vue-cli\node_modules\vue-cli-plugin-nativescript-vue\generator\index.js:199:11)
at Generator.resolveFiles (C:\Users\JanD\AppData\Roaming\npm\node_modules@vue\cli\lib\Generator.js:209:13)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

@jawa-the-hutt
Copy link
Collaborator

jawa-the-hutt commented May 8, 2019

Can I see a list of global packages installed? npm list -g --depth=0
Also, OS version

@jandever
Copy link

jandever commented May 8, 2019

+-- @angular/[email protected]
+-- @vue/[email protected]
+-- @vue/[email protected]
+-- @vue/[email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

npm ERR! peer dep missing: typescript@>=2.0, required by [email protected]
npm ERR! peer dep missing: [email protected] - 14.1.x, required by [email protected]

@jawa-the-hutt
Copy link
Collaborator

What version of node are you running?

side note: realizing we need a standard 'submit issue` list of questions to ask when someone submits an issue.

@jandever
Copy link

jandever commented May 8, 2019

node --version
v8.9.1

@jandever
Copy link

jandever commented May 8, 2019

updating nodejs solved the problem

@codytooker
Copy link
Author

I can't currently get a rundown of global packages as I'm away from the computer but basically the same as above in installing from UI and CLI and trying multiple packages.

I'm guessing it comes this line

let { fileName } = /(?<fileName>[^(\s]+):[0-9]+:[0-9]+/.exec(callSite).groups;
. From my knowledge only ES2018 has the ability to do look behind regular expressions.

@jawa-the-hutt
Copy link
Collaborator

Ok...i was able to reproduce on node version 8 regardless of the version of npm.

@jawa-the-hutt
Copy link
Collaborator

So, I had just commented that I was able to reproduce on any version of Node 8 and saw a couple of notifications come in at the same time with updates from @jandever and @codytooker. However, now the issue doesn't show those comments.

Looks like the fix is to be on node 10.x or above as node 8 doesn't support the look behinds. I'm going to leave this issue open and see if I can come up with a regular expression that will work on node 8, 10 and 12.

May not be possible, but at least the temporary workaround is to upgrade to at least 10.x.

@jawa-the-hutt jawa-the-hutt self-assigned this May 8, 2019
@jawa-the-hutt
Copy link
Collaborator

Should be addressed in #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants