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

Fix tsc build problems #202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Kyle Bebak <[email protected]>",
"description": "React file dropzone and uploader: fully customizable, progress indicators, upload cancellation and restart, zero deps and excellent TypeScript support",
"main": "./dist/react-dropzone-uploader.js",
"types": "./dist/Dropzone.tsx",
"types": "./dist/Dropzone.d.ts",
"keywords": [
"react",
"react-component",
Expand Down Expand Up @@ -68,7 +68,7 @@
}
},
"scripts": {
"build": "rm dist/* && tsc && NODE_ENV=production webpack --config webpack.build.config.js && cp src/styles.css dist/styles.css && cp src/*.ts* dist",
"build": "rm -f dist/* && tsc && NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production webpack --config webpack.build.config.js && cp src/styles.css dist/styles.css",
"dev": "tsc -w -p tsconfig.dev.json & webpack-dev-server --config webpack.config.js --mode development --open",
"styleguide": "tsc -w & styleguidist server",
"build-styleguide": "tsc && styleguidist build",
Expand Down
6 changes: 5 additions & 1 deletion src/Dropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,11 @@ class Dropzone extends React.Component<IDropzoneProps, { active: boolean; dragge
try {
params = await getUploadParams(fileWithMeta)
} catch (e) {
console.error('Error Upload Params', e.stack)
if (e instanceof Error) {
console.error('Error Upload Params', e.stack)
return;
}
console.error('Error Upload Params', e)
}
if (params === null) return
const { url, method = 'POST', body, fields = {}, headers = {}, meta: extraMeta = {} } = params
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"skipLibCheck": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"declaration": true,
"outDir": "dist",
"strict": true
},
"include": ["src/*.tsx", "src/*.ts"],
Expand Down
2 changes: 1 addition & 1 deletion webpack.build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function createConfig(entry, output) {
rules: [
{
test: /\.js?$/,
exclude: /node_modules/,
exclude: [/node_modules/, /src\/*.tsx/],
use: 'babel-loader',
},
{
Expand Down