Skip to content
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

Module not found: Can't resolve '../../data/courses' #95

Open
Cobwebster opened this issue Jul 26, 2020 · 4 comments
Open

Module not found: Can't resolve '../../data/courses' #95

Cobwebster opened this issue Jul 26, 2020 · 4 comments

Comments

@Cobwebster
Copy link

Cobwebster commented Jul 26, 2020

I've had some issues with npm install, it seems to of cherry picked what to install so I had to manually install some stuff,
the site somewhat works in that /sign-up and /login-in work but when I go to the index page it produces that error on the client.

Network error: Unexpected token I in JSON at position 0 Error: Network error: Unexpected token I in JSON at position 0 at new ApolloError (C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\apollo-client\bundle.umd.js:92:26) at C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\apollo-client\bundle.umd.js:1588:34 at C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\apollo-client\bundle.umd.js:2008:15 at Set.forEach (<anonymous>) at C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\apollo-client\bundle.umd.js:2006:26 at Map.forEach (<anonymous>) at QueryManager.broadcastQueries (C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\apollo-client\bundle.umd.js:2004:20) at C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\apollo-client\bundle.umd.js:1483:29 at process._tickCallback (internal/process/next_tick.js:68:7)

and this error on the terminal,

error ] ./src/services/course/index.ts
[0] Module not found: Can't resolve '../../data/courses' in 'C:\Users\Admin\Desktop\project\nextjs-firebase
[0] { Error: Cannot find module for page: /api/graphql
[0] at pageNotFoundError (C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\ne
[0] at Object.getPagePath (C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\n
[0] at DevServer.getPagePath (C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_module88:26)
[0] at DevServer.handleApiRequest (C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_m.js:429:42)
[0] at process._tickCallback (internal/process/next_tick.js:68:7) code: 'ENOENT' }
[0] Network error { ServerParseError: Unexpected token I in JSON at position 0
[0] at JSON.parse ()
[0] at C:\Users\Admin\Desktop\project\nextjs-firebase-authentication\node_modules\apollo-link-http-comm
[0] at process._tickCallback (internal/process/next_tick.js:68:7)
[0] name: 'ServerParseError',
[0] response:
[0] Response {
[0] size: 0,
[0] timeout: 0,
[0] [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
[0] [Symbol(Response internals)]:
[0] { url: 'http://localhost:3000/api/graphql',
[0] status: 500,
[0] statusText: 'Internal Server Error',
[0] headers: [Headers],
[0] counter: 0 } },
[0] statusCode: 500,
[0] bodyText: 'Internal Server Error' }

@Cobwebster Cobwebster changed the title Network error: Only absolute URLs are supported Module not found: Can't resolve '../../data/courses' Jul 26, 2020
@bsplosion
Copy link

bsplosion commented Dec 9, 2020

This seems to be due to src/data/courses appearing in the .gitignore. @rwieruch likely wanted to protect his IP while still providing everyone a MVP implementation of the platform.

Copying the content of src/data/course-storefront.ts into src/data/courses.ts will clear the error, though obviously this limits the ability to run the demo.

@rwieruch, any way we could at least get a skeleton of which attributes/methods/etc would go in that file? While we could probably reverse-engineer it, it's leveraged as part of your resolvers and connectors in a variety of places, so having it be bugged means most of the demo doesn't function.

Edit: seems like that was a directory in February, contained an index.ts with references to other course files (e.g., src/data/courses/road-to-react). It may not actually be possible to run this demo without some IP being exposed or a specially-tailored course being built.

@rwieruch
Copy link
Owner

rwieruch commented Dec 9, 2020

I think I will go through this project in the future and get rid of all the course relevant source code, so that there is only the skeleton for nextjs with firebase as planned in the first place. Sorry for this!

@bsplosion
Copy link

That'd be awesome - thanks for making the project available like this! Even in its current state it's providing help for me when establishing good patterns on an altogether different type of platform.

@alanphanth
Copy link

Hey @rwieruch, Can you provide the tutorial for this problem?

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

No branches or pull requests

4 participants