Closed blacksmoke26 closed 5 years ago
Seems to be working fine here: https://codesandbox.io/s/826xvvxrv2
Do you happen to be working with TypeScript? Is this a duplicate of #33?
Can you reproduce the error on https://codesandbox.io or https://codepen.io/ or https://jsfiddle.net/ or something like that?
Well I am using RollupJS.
ReactJs + Flow
Can you share your project? If not, can you please reproduce the problem on one of the above websites, or a GitHub repo?
I will try to reproduce, maybe CodeSandBox will be useful to share code. Thanks!
@blacksmoke26 any update on this?
@zenflow Moved to Webpack, dropped RollupJS due to so many issues.
Thanks! You can close it now!
Strange that the problem went away when you dropped Rollup..
I'm thinking this could still be a valid issue (when using Rollup, but not when using Webpack or Parcel), but we have no reproduction.. @limonte what would you do here?
It might be a valid issue, but I'd still wait for some effort from the community with the reproduction. We can keep the issue opened so people will find it easier when they will stumble upon the same problem.
This walkthrough involves the following libs:
Finally reproduced:
index.js:7 Uncaught TypeError: MySwal.fire is not a function
at index.js:7
at index.js:7
Note: I assume that you have installed gulp globally.
Steps to reproduce:
npm install
to install packages.npm run rollup
or gulp rollup/build
to compile the source.build/index.html
in a browser (localhost in case)You can skip above and download the following zip file (contains compiled version) to test: build-files.zip
P.S. Please let me know if you need more details.
Thank you very much for your contribution @blacksmoke26 .. I will review this and track down the problem first chance I get
Ok, well it's not a bug in sweetalert2-react-content
, because if you take the reproduction and replace the contents of src/index.js
with this:
class SomeClass {
static someStaticMethod () {
alert('ok')
}
}
class SomeSubClass extends SomeClass {}
SomeSubClass.someStaticMethod('ok');
... we get a very similar error: Uncaught TypeError: SomeSubClass.someStaticMethod is not a function
.
It's a bug in rollup, but it was fixed a long time ago.
The reason it was coming up here is because the rollup-stream
package used here has a hard dependency on rollup@^0.49.2.
Don't use that package.
Followed homepage example but leads to an error!