AllenFang / react-bootstrap-table

A Bootstrap table built with React.js
https://allenfang.github.io/react-bootstrap-table/
MIT License
2.23k stars 782 forks source link

react-toastr 2.8.2 breaking build #838

Closed aliabbas closed 7 years ago

aliabbas commented 8 years ago

when webpacking my application with react-bootstrap-table, the react-toastr@^2.8.0 dependecy pulls in 2.8.2 as it should but I'm getting the following error

./~/react-bootstrap-table/~/react-toastr/~/react/lib/ReactTransitionEvents.js Module not found: Error: Cannot resolve module 'react-dom/lib/getVendorPrefixedEventName'

i'm using node 4.3.1, npm 2.15.1

sgentile commented 8 years ago

Not sure if related, but I got a reactDOM error with react-toastr using the very new 15.4.0

kellyi commented 8 years ago

I encountered this issue, too. I think removing the caret from this line in package.json would fix it by pinning it to always use react-toastr 2.8.0:

https://github.com/AllenFang/react-bootstrap-table/blob/master/package.json#L67

madeinfree commented 8 years ago

Hi, @aliabbas @sgentile @kellyi I see the related issue from https://github.com/tomchentw/react-toastr/issues/86

kellyi commented 8 years ago

It seems like updating React and ReactDOM to 15.4.0 remedied this issue when using v2.5.8 of this library.

AllenFang commented 8 years ago

Just like @kellyi said, I think fix the verion of react-toastr is a workaround currently.

gravitycode commented 8 years ago

Oh no! the damn caret.

AllenFang commented 8 years ago

Fixed on v2.5.9, please upgrade, Solve it by fix react-toastr on v2.8.0

mangreen commented 8 years ago

After changed to install react-bootstrap-table@2.5.9, I still encountered this issue. My react is 0.14.8 and react-dom is 0.14.7

module.js:338 throw err; ^ Error: Cannot find module 'react-dom/lib/getVendorPrefixedEventName' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/Users/XXXXX/Workspace/test/node_modules/react-bootstrap-table/node_modules/react-toastr/node_modules/react/lib/ReactTransitionEvents.js:15:34) at Module._compile (module.js:460:26) at Module._extensions..js (module.js:478:10) at Object.require.extensions.(anonymous function) [as .js] (/Users/XXXXX/Workspace/test/node_modules/babel-core/lib/api/register/node.js:214:7) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12)

vapon commented 8 years ago

Hi, that is true. react-bootstrap-table@2.5.9 doesn't resolve the problem. "Module not found: Error: Cannot resolve module 'react-dom/lib/getVendorPrefixedEventName'"

gravitycode commented 8 years ago

i finally updated to react 15.4.0. Although I think not in all scenarios this is a viable solution. I also had to update react-hot-loader

madeinfree commented 8 years ago

I think this problem from React 15.4.0, I try to change react-toastr react-dom version into 15.3.0 and problem be resolved, react-toastr use below

"dependencies": {
  "react-dom": "^0.14.0 || ^15.0.0"
}

so it will install react-dom 15.4.0 by itself

-- version

--- Edit ---

AllenFang commented 8 years ago

HI everyone, that's my fault, its a invalid fixed. Any solution?

vapon commented 8 years ago

That is the example how caret dependencies can ruin the build. My project become invalid after react 15.4.0 was released (https://facebook.github.io/react/blog/2016/11/16/react-v15.4.0.html) Which version of the react-bootstrap-table uses react-toastr 2.4.0 ? I might downgrade for now.

AllenFang commented 8 years ago

but maybe https://github.com/tomchentw/react-toastr/blob/v2.4.0/package.json#L78 will be a problem.

AllenFang commented 8 years ago

How about fork react-toastr to my repo and link it with git repo url in package.json

madeinfree commented 8 years ago

agree! maybe this is the temporary solution to fix this problem when react-toastr didn't fix this problem.

vapon commented 8 years ago

Thank you very much! Will check which solution fits better.

kellyi commented 8 years ago

Upgrading the top-level React & React-DOM dependencies to 15.4.0 fixed this issue for me.

I believe the problem's that React-Toastr's using an undocumented API which was done away with in 15.4.0. The dependency started breaking immediately after React 15.4 was released -- and this was published:

https://facebook.github.io/react/blog/2016/11/16/react-v15.4.0.html

I think having the latest React installed at the top level will fix it temporarily, although I also think the React-Toastr dependency will fail again whenever the React version's incremented. A long-term fix probably has to involve React-Toastr adjusting how it addresses the React & React-DOM APIs.

kellyi commented 8 years ago

@AllenFang I think using a forked version of React-Toastr with the React/React-DOM-dependencies pinned at whatever version you want for this would work, too.

It looks as if this might be the/one of the culprits in React-Toastr:

https://github.com/tomchentw/react-toastr/blob/b0fadc4afd51d381b983ce499d6cdfb667d319d2/lib/ToastMessage/animationMixin.js#L7

AllenFang commented 8 years ago

I think using a forked version of React-Toastr with the React/React-DOM-dependencies pinned at whatever version you want for this would work, too.

yes, I'll fix it later :) Thanks all you guys give these feedback :+1:

AllenFang commented 8 years ago

hi all, I've released v2.5.10, I think it could fix this issue, please let me know if anything goes wrong. Any feedback is welcome :) thanks.

yschoueri commented 8 years ago

It doesn't work for me with package.json dependency "react-bootstrap-table": "2.5.10"

I get the following error/warning when running npm install

`-- react-bootstrap-table@2.5.10
  +-- UNMET PEER DEPENDENCY react@^0.14.0 || <15.4.0
  `-- react-toastr@2.8.2  (git+https://github.com/AllenFang/react-toastr.git#777bb9a700de183bd123e9f6e2845164cd77ed87)
    +-- react-addons-update@15.3.2
    `-- react-dom@15.3.2

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.15
npm WARN react-toastr@2.8.2 requires a peer of react@^0.14.0 || <15.4.0 but none was installed.

and this one when starting my server in hot reload

ERROR in ./~/react-bootstrap-table/lib/toolbar/ToolBar.js
Module not found: Error: Cannot resolve module 'react-modal' in C:\Users\yschoueri.STW\Documents\Code\bidconf-ui\node_modules\react-bootstrap-table\lib\toolbar
 @ ./~/react-bootstrap-table/lib/toolbar/ToolBar.js 25:18-40

ERROR in ./~/react-toastr/~/react-dom/index.js
Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in C:\Users\yschoueri.STW\Documents\Code\bidconf-ui\node_modules\react-toastr\node_modules\react-dom
 @ ./~/react-toastr/~/react-dom/index.js 3:17-46
Shaywei commented 8 years ago

I am getting erros on npm install:

ERROR in ./~/react-bootstrap-table/lib/toolbar/ToolBar.js
Module not found: Error: Cannot resolve module 'react-modal' in /Users/shayweiss/git/.../frontend/node_modules/react-bootstrap-table/lib/toolbar
 @ ./~/react-bootstrap-table/lib/toolbar/ToolBar.js 25:18-40

ERROR in ./~/react-toastr/~/react-dom/index.js
Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in /Users/shayweiss/git/.../frontend/node_modules/react-toastr/node_modules/react-dom
 @ ./~/react-toastr/~/react-dom/index.js 3:17-46

Reverting to 2.5.8 solved the problem.

qiusli commented 8 years ago

Got the following error building my project, not sure why. Any suggestions?

npm ERR! git clone --template=h:\dash\npm\2\npm-cache_git-remotes_templates --mirror https://github.com/AllenFang/reac t-toastr.git h:\dash\npm\2\npm-cache_git-remotes\git-https-github-com-AllenFang-react-toastr-git-72d29d72: Cloning into bare repository 'h:\dash\npm\2\npm-cache_git-remotes\git-https-github-com-AllenFang-react-toastr-git-72d29d72'... npm ERR! git clone --template=h:\dash\npm\2\npm-cache_git-remotes_templates --mirror https://github.com/AllenFang/reac t-toastr.git h:\dash\npm\2\npm-cache_git-remotes\git-https-github-com-AllenFang-react-toastr-git-72d29d72: npm ERR! git clone --template=h:\dash\npm\2\npm-cache_git-remotes_templates --mirror https://github.com/AllenFang/reac t-toastr.git h:\dash\npm\2\npm-cache_git-remotes\git-https-github-com-AllenFang-react-toastr-git-72d29d72: fatal: Unabl e to find remote helper for 'https' npm ERR! Windows_NT 6.1.7601 npm ERR! argv "c:\PROGRA~1\nodejs\63847A~1.1\node.exe" "c:\PROGRA~1\nodejs\63847A~1.1\node_modules\npm\bin\np m-cli.js" "install" npm ERR! node v6.3.1 npm ERR! npm v3.10.3 npm ERR! code 128

npm ERR! Command failed: git -c core.longpaths=true clone --template=h:\dash\npm\2\npm-cache_git-remotes_templates --m irror https://github.com/AllenFang/react-toastr.git h:\dash\npm\2\npm-cache_git-remotes\git-https-github-com-AllenFang- react-toastr-git-72d29d72 npm ERR! fatal: Unable to find remote helper for 'https' npm ERR! npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:

sgentile commented 8 years ago

So I have a build that was using "react-bootstrap-table": "^2.5.6",

Now it's started failing on me today..

ERROR in ./~/react-bootstrap-table/lib/toolbar/ToolBar.js Module not found: Error: Cannot resolve module 'react-modal' in .../client/node_modules/react-bootstrap-table/lib/toolbar @ ./~/react-bootstrap-table/lib/toolbar/ToolBar.js 25:18-40

ERROR in ./~/react-toastr/~/react-dom/index.js Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in .../client/node_modules/react-toastr/node_modules/react-dom @ ./~/react-toastr/~/react-dom/index.js 3:17-46

"react": "^15.3.2", "react-addons-css-transition-group": "^15.3.2", "react-bootstrap": "^0.30.3", "react-bootstrap-table": "^2.5.6", "react-datetime": "^2.6.0", "react-dom": "^15.3.1",

On Tue, Nov 22, 2016 at 12:04 PM, Allen notifications@github.com wrote:

hi all, I've released v2.5.10, I think it could fix this issue, please let me know if anything goes wrong. Any feedback is welcome :) thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AllenFang/react-bootstrap-table/issues/838#issuecomment-262300233, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIFNJuVHUCNDG0nEu7iEBORxwKIWJyPks5rAyCGgaJpZM4K0Sl8 .

qiusli commented 8 years ago

@sgentile try using 2.5.8. It worked for me.

fachhoch commented 8 years ago

I am getting this error ERROR in ./~/react-bootstrap-table/~/react-dom/index.js Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in C:\dev\react-dev\app8\123\react-gs\node_modules\react-bootstrap-table\node_modules\react-dom @ ./~/react-bootstrap-table/~/react-dom/index.js 3:17-46

react dependencies "react": "^15.4.0", "react-bootstrap-table": "^2.5.8", "react-dom": "^15.4.0", "react-modal": "^1.5.2", "react-toastr": "^2.8.0",

Please advice, I am new bee getting started with react.

sgentile commented 8 years ago

I got burned by the caret...

sgentile commented 8 years ago

Curious others thoughts - so this change basically broke everyone using ^2.5.x - which was the default when you run npm install at that time.

Since it was such a breaking item, is it more appropriate to do larger version changes once dependencies change ?

ie. instead of the 2.5.8 that caused the issue, moving to 3.0 ?

edit:

https://docs.npmjs.com/getting-started/semantic-versioning

"Changes which break backwards compatibility: Major release, increment the first number, e.g. 2.0.0"

fachhoch commented 8 years ago

moving to 3.0 fixed the build, thank you.

AllenFang commented 8 years ago

I still figure why have following error

ERROR in ./~/react-bootstrap-table/lib/toolbar/ToolBar.js
Module not found: Error: Cannot resolve module 'react-modal' in
.../client/node_modules/react-bootstrap-table/lib/toolbar
 @ ./~/react-bootstrap-table/lib/toolbar/ToolBar.js 25:18-40

I'll unpublish v2.5.10 later and I must apologize for this upgrading to everyone.

AllenFang commented 8 years ago

v2.5.10 unpublished, this https://github.com/AllenFang/react-bootstrap-table/pull/854 PR solve some issue about react@15.4.x and dependency issue.

In next stage, I'll try to figure what's going on for the trouble of v2.5.10 and test next patch more details about forking react-toastr and narrow down the react version on it.

if there's no any better solution, I'll replace react-toastr with other package as soon as possible.

Sorry for these accidents with my careless.

rahul1059 commented 8 years ago

@AllenFang Can you publish a build with react-toastr fixed 2.8.0.

AllenFang commented 8 years ago

@rahul1059, I've do it on v2.5.9, but problem still remain. The root cause is https://github.com/AllenFang/react-bootstrap-table/issues/838#issuecomment-262178484

the problem is the caret on react-dom and react.

rahul1059 commented 8 years ago

@AllenFang I followed these steps and it worked:

AllenFang commented 8 years ago

@rahul1059, what the version of your npm

rahul1059 commented 8 years ago

2.14.9 This might be a temporary fix that can help to deploy files at least. With current changes build fails and so the deployment.

vapon commented 8 years ago

Guys, I just have performed clean 'npm install' and everything worked fine. And when looked up into node_modules, I discovered that react-dom ver. 15.14.1 was installed (released 7 hours ago (!)). So seems like getVendorPrefixedEventName was reverted. At least I could see it.

AllenFang commented 8 years ago

https://github.com/facebook/react/releases/tag/v15.4.1 But I cant figure why. Any evidence for fixing getVendorPrefixedEventName problem?!

AllenFang commented 8 years ago

BTW, https://github.com/AllenFang/react-bootstrap-table/releases/tag/v2.6.0-beta.1

I release v2.6.0-beta.1, anyone can try it?

npm install react-bootstrap-table@2.6.0-beta.1

madeinfree commented 8 years ago

OK, I helping to try this version, yes just like @vapon say 15.4.1 is resolve this problem. but as you've said why 15.4.1 fixed this problem

AllenFang commented 8 years ago

@madeinfree, if you have time, you can try 15.4.0 and 15.4.1 both condition. BTW, today, I cant reproduce this issue in my client. I almost blow up today..

AllenFang commented 8 years ago

I dont see any error on webpacking, but got following error on page running,

invariant.js:38 Uncaught Error: Objects are not valid as a React child (found: Error: id can't be empty value.). 
If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of `ToastMessage.animation`.(…)

Reproduce steps:

  1. enable insertRow
  2. click insert button on page
  3. dont keyin any data
  4. Click save button
  5. Above error appear on browser console

I expect that there should be a toastr popup

Env:

React@15.4.0, 15.4.1, 15.3.2 react-bootstrap-table@2.6.0-beta.1 npm@3 Node@6.0.0

vapon commented 8 years ago

@AllenFang, you are right NO evidence of fixing it within the React's release notes, that's why I was surprised and checked node_modules. I'm just a narrow minded java developer and still thinking that using fixed dependencies in package.json is the best way.

rahul1059 commented 8 years ago

v2.6.0-beta.1

not working react/react-dom 0.14.8. I haven't updated my react.

AllenFang commented 8 years ago

@rahul1059, any error message?

AllenFang commented 8 years ago

Some feedback

npm@2 + react-bootstrap-table@2.5.9 + react@15.3.2 wepbacking fail cause by Cannot resolve module 'react-dom/lib/getVendorPrefixedEventName'

npm@3 + react-bootstrap-table@2.5.9 + react@15.3.2 wepbacking pass but got invariant.js:38 Uncaught Error: Objects are not valid as a React child on runnging

npm@2 + react-bootstrap-table@2.6.0-beta.1 + react@15.3.2 wepbacking pass but got invariant.js:38 Uncaught Error: Objects are not valid as a React child on runnging

npm@3 + react-bootstrap-table@2.6.0-beta.1 + react@15.3.2 wepbacking pass but got invariant.js:38 Uncaught Error: Objects are not valid as a React child on runnging

npm@2 + react-bootstrap-table@2.5.9 + react@15.4.0 or react@15.4.1 wepbacking pass but got invariant.js:38 Uncaught Error: Objects are not valid as a React child on runnging

npm@3 + react-bootstrap-table@2.5.9 + react@15.4.0 or react@15.4.1 wepbacking pass but got invariant.js:38 Uncaught Error: Objects are not valid as a React child on runnging

npm@2 + react-bootstrap-table@2.6.0-beta.1 + react@15.4.0 or react@15.4.1 wepbacking pass but got invariant.js:38 Uncaught Error: Objects are not valid as a React child on runnging

npm@3 + react-bootstrap-table@2.6.0-beta.1 + react@15.4.0 or react@15.4.1 wepbacking pass but got invariant.js:38 Uncaught Error: Objects are not valid as a React child on runnging

AllenFang commented 8 years ago

if someone got the following error after use v2.6.0-beta,

invariant.js:38 Uncaught Error: Objects are not valid as a React child (found: Error: id can't be empty value.). 
If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of `ToastMessage.animation`.(…)

check https://github.com/AllenFang/react-bootstrap-table/issues/838#issuecomment-262464705 to test it please tell me. I thinks this is a issue from react-toastr probably?!

rahul1059 commented 8 years ago

I am getting same error message. Cannot resolve module 'react-dom/lib/getVendorPrefixedEventName'

AllenFang commented 8 years ago

Fixed on v2.6.0. you should not see any module resolve issue when webpacking and no any error on running. This https://github.com/AllenFang/react-bootstrap-table/issues/838#issuecomment-262557072 solved on v2.6.0.

If any trouble or issue is related with react-toastr, please tell me. Thanks.