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

src/index.ts Cannot be found with by webpack dev server #87

Closed
sebastiaandegeus opened this issue Jun 5, 2018 · 2 comments
Closed

src/index.ts Cannot be found with by webpack dev server #87

sebastiaandegeus opened this issue Jun 5, 2018 · 2 comments

Comments

@sebastiaandegeus
Copy link

Hi, I really like this package but recently I ran into a problem in a TypeScript project:

Hot reloading does not work well. I don't have this problem for other packages like typeorm which also provides it's own type definitions.

17:13:28 webpack.1    | (Emitted value instead of an instance of Error) Cannot find source file '../../src/index.ts': Error: Can't resolve '../../src/index.ts' in '/Users/me/project/node_modules/graphql-request/dist/src'
17:13:28 webpack.1    |  @ ./client/components/orgs.tsx 2:0-42 23:8-15
17:13:28 webpack.1    |  @ ./client/components/client.tsx
17:13:28 webpack.1    |  @ ./client/index.tsx
17:13:28 webpack.1    |  @ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server babel-polyfill ./client/index.tsx
17:13:28 webpack.1    |

For some reason it's traversing 2 directories up and then failing to find that file.

@DrChrispoper
Copy link

I found the same issue and the answer here:
apollographql/react-apollo#597 (comment)

To quote:
"In my webpack config I have the source-maps-loader but didn't exclude node_modules and this seemed to be causing the issue. Adding the exclude fixed it for me."

And the config should be:

      {
        enforce: 'pre',
        test: /\.js$/,
        loader: 'source-map-loader',
        exclude: [/node_modules/, /build/, /__test__/],
      },

@jonkoops
Copy link
Collaborator

jonkoops commented Nov 5, 2023

I am unable to reproduce this issue in the latest version of WebPack, so I will assume this issue is fixed. If someone is still experiencing issues let us know.

@jonkoops jonkoops closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2023
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

3 participants