react-dropzone / file-selector

Convert a DragEvent or file input to a list of File objects
MIT License
95 stars 33 forks source link

Build source maps points to srcc/**.ts but src is not included in final bundle #39

Closed Psvensso closed 4 years ago

Psvensso commented 4 years ago

Using via react-dropzone, v0.2.2

Source maps points to src/ files but src/ is not included. Should either be set to inline-sourcemaps or include the src or don't provide sourcemaps in final build.

dist/es5/index.js.map:1 "sourceRoot":"","sources":["../../src/index.ts"]

What is the current behavior? "*app: Failed to parse source map from '**\node_modules\file-selector\src\file-selector.ts' file: Error: ENOENT: no such file or directory, open '****\node_modules\file-selector\src\file-selector.ts'"

rolandjitsu commented 4 years ago

@Psvensso thanks for reporting. I will push a fix for that soon.

steveHornseyDeveloper commented 4 years ago

FYI if you are using webpack and source-map-loader then you can configure it in the following way to silence the error:

   {
        enforce: 'pre',
        test: /\.js$/,
        loader: 'source-map-loader',
        exclude: [
          path.resolve(__dirname, './node_modules/file-selector/dist/es5'),
        ],
     },
rolandjitsu commented 4 years ago

Should be fixed now. Please update to 0.1.8/0.2.3 and let me know if it's ok.

jasperprins commented 4 years ago

Thanks. seems to be fixed

MattyBalaam commented 4 years ago

I’m not sure if I’m doing something wrong, but we have "react-dropzone": "^11.2.4" as a dependency and in our webpack build we are still getting errors, we have a monorepo using Typescript and we are using pnpm

Failed to parse source map from '/Users/matthew.balaam/frontend/node_modules/.pnpm/file-selector@0.2.3/node_modules/file-selector/src/file-selector.ts' file: Error: ENOENT: no such file or directory, open '/Users/matthew.balaam/frontend/node_modules/.pnpm/file-selector@0.2.3/node_modules/file-selector/src/file-selector.ts'
@ /Users/matthew.balaam/frontend/node_modules/.pnpm/file-selector@0.2.3/node_modules/file-selector/dist/es5/index.js 1:0-44 1:0-44
@ /Users/matthew.balaam/frontend/node_modules/.pnpm/react-dropzone@11.2.4_react@17.0.1/node_modules/react-dropzone/dist/es/index.js