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
ns
prototype is null, but that breaks some things
#2147
Comments
React isn't an ES module though so shouldn't be a namespace - rather it should be used via Is this because you are using the named exports extension? It is very important not to change this - namespaces have an empty prototype by the ECMAScript specification. |
Yes, I discovered this when talking with someone setting up single-spa. They are using the named-exports extra because that's the easiest way to be able to do |
I would suggest getting React table to fix this as a bug in that project then - that they are detecting a namespace using a technique that is not spec valid for namespaces. |
The problem is this bug in Rollup - rollup/rollup#3420 which was released in 1.32.1 - when React table uses that build it will resolve the issue. I would suggest posting an issue to React table to get a new build out with that release asap. |
Good catch - I had just verified that rollup does this correctly now with this repl example. It looks react-table isn't yet on 1.32.1 - https://github.com/tannerlinsley/react-table/blob/master/yarn.lock#L6720. I'll create a pull request to upgrade this for them. |
I have created TanStack/table#2021 to resolve this issue in react-table. |
…stemjs#2147. (#2021) Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
…stemjs#2147. (#2021) Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
…stemjs#2147. (#2021) Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
…stemjs#2147. (#2021) Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
systemjs/src/system-core.js
Line 83 in 0f1161d
Some projects assume that their dependencies have the full object prototype available to them. For example, the popular react-table project does this (see line 7 of react-table.development.js)
This throws an Error when the dependency (in this case
react
) does not have the Object.prototype methods on it.Is there any reason not to change that code to be
ns = {}
, so that the prototype is Object.prototype?@guybedford thoughts?
The text was updated successfully, but these errors were encountered: