Comments (14)
same issue here, I am using react-scripts-ts
so I cannot change the webpack configuration. Any suggestion?
from react-diff-viewer.
I made the target as esnext because I wanted the lib files to include all latest syntax. Then, the consumer can change their target according to their needs.
@praneshr I think It's better to indicate this module is targeted to ESNEXT in README file, so that we can add this module to the transpiling target.
from react-diff-viewer.
I have the same issue, need some help.
from react-diff-viewer.
I solved this problem by doing as follow:
//webpack -> modules.rules
test: /.jsx?$/,
loader: 'babel-loader',
exclude: function (modulePath) {
return /node_modules/.test(modulePath) &&
!/node_modules\react-diff-viewer/.test(modulePath);
}
hope this will help you.
from react-diff-viewer.
Any hints here @praneshr? This is preventing me from using the version 2.x of the package
from react-diff-viewer.
@daniel-trinh Can you share your tsconfig.json?
from react-diff-viewer.
This is my tsconfig.json
:
{
"compilerOptions": {
"baseUrl": "src",
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": ["dom", "es6"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"exclude": ["node_modules", "build", "coverage", "scripts", "acceptance-tests", "webpack", "jest"]
}
from react-diff-viewer.
here's mine, looks similar to the one above
{
"compilerOptions": {
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": [
"es6",
"dom"
],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
],
"baseUrl": "./",
"paths": {
"react": [
"node_modules/@types/react"
]
},
"include": [
"src"
]
}
from react-diff-viewer.
Guys, I'm not able to reproduce this issue. I created a new project and used a modified version of your tsconfigs. Everything works fine.
Run the following commands.
yarn install
yarn build
I made the target as esnext
because I wanted the lib files to include all latest syntax. Then, the consumer can change their target according to their needs.
I'm consuming the lib files for the examples. It works fine.
from react-diff-viewer.
I see, I tried with that tsconfig and it's not working for me either so I assume that the problem is other. I am using older versions for typescript and react so that's maybe the issue? I have updated typescript and the problem persists (unfortunately I cannot update react easily). Maybe @daniel-trinh can confirm if that's an issue for him?
from react-diff-viewer.
@andresmgot The zip didn't work for you? Can you confirm the typescript version you're using?
from react-diff-viewer.
@andresmgot The zip didn't work for you? Can you confirm the typescript version you're using?
Yes, sorry. The zip works for me, what doesn't work for me is to use that tsconfig in my project (I get the same result, the only change is the strictNullChecks
so that's why I assumed that the problem is somewhere else.
Regarding my last comment, I have tried again using the latest react ^16.11.0 and typescript ^3.7.2 but the problem is the same so no clue what could be happening...
I guess that the problem is that when using react-scripts-ts
the webpack configuration is different than just running tsc
.
from react-diff-viewer.
@andresmgot react-scripts-ts
was updated a year ago. May be the dependencies are old. I will recommend you to use latest webpack or tsc.
I will keep this bug open for few more days. Let me know if you need my help.
from react-diff-viewer.
Closing this issue as the issue cannot be reproduced in an ideal scenario.
from react-diff-viewer.
Related Issues (20)
- I'm getting this" classnames_1.default is not a function" i couldn't understand. is there any bootstrap version dependency
- I'm getting type error:" classnames_1.default is not a function" , is there any bootstrap version dependency ??
- nearbySequences like in react-diff-view
- the demo provided in readme.md run like this,how to fix it?
- Add a Copy button HOT 1
- Text not visible for too long content HOT 6
- Use DiffViewer inside Shadow DOM HOT 2
- Prism syntax highlighting does not work for multi-line comments
- Compare Difference Row Exception
- Accept texts with the difference already made
- Can I hide the 'Expand 1 lines...' at the top? HOT 1
- What are the conditions of the lines to which Expand Lines apply? HOT 1
- What is the performance ceiling of this componnet? HOT 1
- Reverse Diff
- bug handling added/removed empty lines
- CJS default export types are improperly configured
- can't select diff text properly! ⛔ HOT 2
- Line Selection Bug 🪲
- diff performance with large json data
- ReferenceError: _jsxs is not defined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-diff-viewer.