Prisma1: handle node 6 gracefully

Created on 30 Apr 2018  Â·  12Comments  Â·  Source: prisma/prisma1

Bug Report

After upgrading to prisma 1.7.3 and applying the new prisma.yml structure >>
removing keys: service, stage, cluster
adding key: endpoint

Using node-v6.11.1

Getting this Error:
TypeError: url_1.URL is not a constructor
Stack trace:

at parseEndpoint (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:405:15) at PrismaDefinitionClass.get [as service] (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:108:13) at PrismaDefinitionClass.validate (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:148:14) at PrismaDefinitionClass.<anonymous> (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/PrismaDefinition.ts:78:12) at step (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:32:23) at Object.next (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:13:53) at fulfilled (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/PrismaDefinition.js:4:58)

When downgrading to V1.6.3
npm i -g [email protected]
and restoring the prisma.yml old format (with cluster and service definitions and without the endpoint: url), I can deploy again.

Upgraded again to prisma 1.7.3 and maintained the keys:
service, stage, cluster + endpoint key,
I can deploy again (using the new V)

kinfeature arecli

Most helpful comment

Hi @marktani ,
I upgraded my node version to 10.0.0 and the issue got fixed. Earlier node version was in 6.9.1

All 12 comments

Can you share a minimum setup to reproduce this error?
Ideally in the form of a repository.

Hi @marktani ,
I have used this setup https://www.prisma.io/docs/tutorials/prisma-basics/getting-started-ouzia3ahqu and when I tried to do prisma playground, I got the below error.

➜ hello-world prisma playground
â–¸ url_1.URL is not a constructor

Get in touch if you need help: https://www.graph.cool/forum

Hi @marktani ,
I upgraded my node version to 10.0.0 and the issue got fixed. Earlier node version was in 6.9.1

Thanks for the follow up! The CLI should handle older node versions gracefully.

I'm running 6.9.4, had the same error. Can we include the requirements for the node version in the getting started docs? I wasn't able to find that anywhere.

Or maybe we could include another step of installing nvm, and creating a version file in the directory.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

I am unable to reproduce this issue with node 6.x. This was resolved in 6.13.0 via https://github.com/nodejs/node/pull/7448

However, CLI should still handle the crash gracefully, so, I would keep this open.

I can also confirm that I am able to reproduce this issue in node version 6.11.1.

Following vagrant file can be used to reproduce this

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.synced_folder "/Users/divyendusingh/Documents/projects/graphcool/prisma", "/home/vagrant/prisma"
  config.vm.synced_folder ".", "/home/vagrant/prisma-3205"
  config.vm.provision :shell, :path => "bootstrap.sh"
end

#!/usr/bin/env bash

# Node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

nvm install v6.11.1

Then vagrant ssh, go to /home/vagrant/prisma/cli/packages/prisma-cli folder and run ./dist/index.js (to run Prisma CLI).

I was able to reproduce this issue while using deploy command and not version or init.

This is fixed in the latest beta - 1.25.0-beta.21 (npm install -g prisma@beta). Please give it a go and let me know if that works for you. Thanks.

This is available in the latest version 1.25.0, npm install -g prisma. I am closing this issue. Please let me know if the issue still persists via opening a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schickling picture schickling  Â·  3Comments

thomaswright picture thomaswright  Â·  3Comments

AlessandroAnnini picture AlessandroAnnini  Â·  3Comments

marktani picture marktani  Â·  3Comments

notrab picture notrab  Â·  3Comments