timhall / svelte-apollo

Svelte integration for Apollo GraphQL
MIT License
947 stars 68 forks source link

Can't run example #35

Closed justinmoon closed 3 years ago

justinmoon commented 4 years ago
$ git clone git@github.com:timhall/svelte-apollo.git
$ cd svelte-apollo
$ npm i
$ npm run example
rollup v1.17.0
bundles src/main.js → public/bundle.js...
GraphQL server listening on localhost:4001
[!] Error: Could not resolve '../../' from src/App.svelte
Error: Could not resolve '../../' from src/App.svelte
    at error (/home/justin/dev/experiments/svelte-apollo/node_modules/rollup/dist/rollup.js:9408:30)
    at ModuleLoader.handleMissingImports (/home/justin/dev/experiments/svelte-apollo/node_modules/rollup/dist/rollup.js:16442:17)
    at ModuleLoader.<anonymous> (/home/justin/dev/experiments/svelte-apollo/node_modules/rollup/dist/rollup.js:16493:26)
    at Generator.next (<anonymous>)
    at fulfilled (/home/justin/dev/experiments/svelte-apollo/node_modules/rollup/dist/rollup.js:15466:28)

1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! svelte-apollo@0.3.0-beta.3 example:build: `cd example && rollup -c -w`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the svelte-apollo@0.3.0-beta.3 example:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/justin/.npm/_logs/2019-12-31T23_20_49_232Z-debug.log
ERROR: "example:build" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! svelte-apollo@0.3.0-beta.3 example: `run-p example:*`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the svelte-apollo@0.3.0-beta.3 example script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/justin/.npm/_logs/2019-12-31T23_20_49_321Z-debug.log
jasonzhouu commented 4 years ago

I come across the same problem

lisabeyy commented 4 years ago

svelteApollo is not defined / when running the example I also tried to create an alias in output.globals but still the same issue.

Could you please provide us with a real; working example , and steps to run it properly ?

Kindest regards

frederikhors commented 4 years ago

Hi all.

The example is working.

After:

$ git clone https://github.com/timhall/svelte-apollo.git
$ cd svelte-apollo
$ npm i

do a

$ npm run build

and then a

$ npm run example
jasonzhouu commented 4 years ago

@frederikhors Thank you for sharing your experience, but I still get an error when execute npm run build:

Error: Cannot find module './build/bindings/iltorb.node'

OS: Manjaro Linux Nodejs version: tried with v13.5.0, v12.13.0, v8.11.1 npm version: 6.13.4, 5.6.0

frederikhors commented 4 years ago

Your environment is the problem. Upgrade nodejs.

lisabeyy commented 4 years ago

Hi all.

The example is working.

After:

$ git clone https://github.com/timhall/svelte-apollo.git
$ cd svelte-apollo
$ npm i

do a

$ npm run build

and then a

$ npm run example

I do this on two different environment and get the following : main.js:8 Uncaught ReferenceError: svelteApollo is not defined

jasonzhouu commented 4 years ago

@frederikhors I have tried nodejs v13.5.0, which is the newest version show on https://nodejs.org/en/. Could you show your environment?

frederikhors commented 4 years ago

@justinmoon, @jasonzhouu, still having problems?

If not please close this.