-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Polyfills ERROR TypeError: Function.prototype.toString requires that 'this' be a Function at Boolean.toString (<anonymous>) #1334
Comments
Cannot help without a full repro, this seems more like an AWS problem and unrelated to the project. |
Everything was working well before. My last working version is angular-slickgrid 6.6.2 |
do you mean that you get this error with 6.6.3 as well? I cannot replicate this, the GitHub Live Demo is built using a Production build and is working fine. It's really hard to do anything from my side, the best you can do is click on the console error and follow the stack trace with the error and see where the error is thrown. I'm not using |
Yes, It's showing an error for the 6.6.3 , 6.6.6, and 7.0.3 versions. Until 6.6.2 no issues. So I randomly checked a few higher versions. All were giving me the same error. I am getting error from the following code . I did not write this code. As part of polyfills its coming from Zone file I guess Zone.__load_patch("toString", e=>{ |
can you try to npm/yarn override the zone.js dependency? I know it's been updated from 0.13.x to 0.14.x not that long ago |
I tried zone.js . It does not help But I found an interesting thing.. Can you please check the below code? Its from the angular slick grid. I found that there is toString function used in the isPlainObject method. Could you please check. initialization(m) { mergeGridOptions(m) { static extend(...e) {
|
there is a Looking at the compatibility table I created, it looks like v6.6.2 was using universal v3.6.0 and slickgrid v4.1.5, but I'm not sure about v6.6.3 since I didn't log that one in the table. |
angular-slickgrid@6.6.2 This is the last working version for me. Then I tried to upgrade to the latest. But I got the toString error. Then I downgraded to angular-slickgrid@6.6.6 Just now I found that the following combination is working There is no version available between 6.6.2 and 6.6.3 I guess. |
When you say the last working version, is it 6.6.2 or 6.6.6? I thought you said 6.6.2 earlier but I'm not sure anymore since your last comment. Please confirm what exactly is the last working version. If it's 6.6.2 then maybe try to npm override slickgrid dependency to 4.1.5 which was the version used in 6.6.2 Side note, that's the biggest change in v7, slickgrid external dependency is dropped, that's less dependency to take care of. |
I am sorry for the confusion. The last working version is angular-slickgrid@6.6.5 The latest version is not working for me. |
does it work with 6.6.6? if not then I can see what changed between 6.6.5 and 6.6.6... but if it's only breaking after the next major 7.0, then I cannot help and need a full repro, there's just way too much code change internally to trace back the root cause and it's impossible to know without a full repro. I will say again, the best option for you is to either provide a full repro or troubleshooting it yourself by looking at the stack trace and adding breakpoints and/or disable some grid options or column definition props. I also want to point out again that every single release, and PRs, are fully tested with Jest/Cypress and a Production build is run replaces the GitHub Live Demo every time a new release is pushed. The Prod build is also executed in every PR and is being used to run the Cypress E2E tests) and I don't see any errors on my side. There must be some particular code on your side that adds these errors on your side (maybe your data or your column definitions or grid options)... so all that to say again that without a fully working repro I cannot provide much more help, the ball is in your court |
I have attempted various approaches, but none of them seem to be effective for me. As a result, I started a new Angular project and utilized basic grid coding, which is currently working when running from the source code. However, after publishing the project, the code is not working. Would it be possible for you to review it? |
For security reason, I will not download neither execute a zip file. There are various other ways to share code, you can create a GitHub project (the easiest), or use JSFiddle, Stackblitz or anything similar. Or you could give me access to one of your AWS site as long as I could troubleshoot the stack trace. However, I also mentioned multiple times that I already ran a Prod build and it is hosted on GitHub for the Live Demo and it is working fine for the 30 or so examples. At this moment I don't have access to other only website to test with. |
I have uploaded to GitHub |
can you publish the dist to a GitHub Page, does it throw the error from there? If you've never done that then, it's similar to the Angular-Slickgrid demo like below but your branch should be |
Sorry for wasting your time. When I tried to publish it gave me https://roopeshkurian.github.io/AngularSlickgrid/ Anyway thank you for your support I will keep on checking . |
- I'm not sure if it's related or not but this Angular-Slickgrid issue came up with this error so I wonder if this could help to use older code that is more compatibile ```ts Function.prototype.toString requires that 'this' be a Function at Boolean.toString ``` ghiscoding/Angular-Slickgrid#1334
I remembered that I recently started using For the SlickGrid libs, I'm only expecting to release another version them in a day or two, so up to you if you want to wait or give it a try earlier, there's a good chance that it would be related since that is the only place I found to be using the |
Thank you so much for solving it. I will use 1.1.2 now and test again. Note: I tested version 1.1.2, but it still gave me the same error. |
There's at least another user who has the same problem displayed on Stack Overflow but again I cannot replicate this issue myself so I cannot provide any help. If any of you can provide a website where this occur then I can troubleshoot, but as it is now I cannot because I don't have that issue. Are you sure that you're using the latest |
the `extend` function that was added to SlickGrid core utils seems to be causing problems when Angular-Slickgrid are published on external website as per this issue: ghiscoding/Angular-Slickgrid#1334 - the node-extend came from this popular npm package: https://github.com/justmoon/node-extend/blob/v1.2.0/test/index.js the reason, I reimplemented it in here is because the npm package is using old CJS syntax and is not ESM friendly, moving the code in here would be better with newer syntax and less CJS code, also less external dependencies
I am using the latest multiple-select-vanilla. I uploaded the dist folder from https://github.com/roopeshkurian/AngularSlickgrid to the following location. You can see the error there. |
* feat(utils): replace slick-core extend utils with `node-extend` the `extend` function that was added to SlickGrid core utils seems to be causing problems when Angular-Slickgrid are published on external website as per this issue: ghiscoding/Angular-Slickgrid#1334 - the node-extend came from this popular npm package: https://github.com/justmoon/node-extend/blob/v1.2.0/test/index.js the reason, I reimplemented it in here is because the npm package is using old CJS syntax and is not ESM friendly, moving the code in here would be better with newer syntax and less CJS code, also less external dependencies * chore: replace all previous slickcore extend with node-extend
I have reimplemented the |
looking back at the provided AWS website, it seems that the reimplementation of |
Yes, it worked well. Thank you so much for your support. |
Thanks for confirming, happy holidays :) |
Happy Holidays :-) |
Describe the bug
I am trying to load a basic grid. But its showing the following error.
ERROR TypeError: Function.prototype.toString requires that 'this' be a Function
at Boolean.toString ()
at Boolean.f (polyfills.83bf772aef6d3363.js:1:19862)
at A.isPlainObject (9183.30ab7e6c5644b258.js:1:97553)
at A.extend (9183.30ab7e6c5644b258.js:1:98017)
at ae.mergeGridOptions (9183.30ab7e6c5644b258.js:1:884921)
at ae.initialization (9183.30ab7e6c5644b258.js:1:868204)
at ae.ngAfterViewInit (9183.30ab7e6c5644b258.js:1:865534)
at Gf (main.8220ccfd1ba21023.js:1:262994)
at Lm (main.8220ccfd1ba21023.js:1:263141)
at Zu (main.8220ccfd1ba21023.js:1:262899)
handleError @ main.8220ccfd1ba21023.js:1
Reproduction
Source code everything working fine. Publish the source and upload to AWS hosting or similar.
Expectation
There should not be any errors. It should display the grid.
Environment Info
Validations
The text was updated successfully, but these errors were encountered: