You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've updated to version 3.9.2 and now it's no longer possible to redefine exports. I'm not sure if it is the expected behaviour from now on since it was introduced as a feature (#35967)
Object.defineProperty(exports, "isOne", { enumerable: true, get: function () { return fixed_module_1.isOne; } });
^
TypeError: Cannot redefine property: isOne
at Function.defineProperty (<anonymous>)
at Object.<anonymous> (/tmp/test/modified-module.js:15:8)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/tmp/test/index.js:3:25)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
Bonus:
It actually works if I redefine the export in the same file:
The text was updated successfully, but these errors were encountered:
leon19
changed the title
Cannot redefine exports when exporting identifiers with the same name in different files
Cannot redefine exports when exporting identifiers with the same name from different files
May 13, 2020
yvann
added a commit
to prismamedia/graphql-platform
that referenced
this issue
May 15, 2020
I've updated to version 3.9.2 and now it's no longer possible to redefine exports. I'm not sure if it is the expected behaviour from now on since it was introduced as a feature (#35967)
TypeScript Version: 3.9.2
Search Terms:
Code
Let's suppose I've the following files
fixed-module.ts
In this files I've fixed some extrange behaviour from
module.ts
modified-module.ts
In this file I export the whole
module.ts
alongside the fixes I've been applied in order to have the imports frommodule.ts
in a single fileindex.ts
This file represents my app
Later on, when I want to to run my app:
Bonus:
It actually works if I redefine the export in the same file:
Expected behavior:
I should be allowed to redefine exports
Actual behavior:
The export cannot be redefined and it throws an error
Related Issues: #35967
The text was updated successfully, but these errors were encountered: