Closed a3957273 closed 1 year ago
Hrmmm, interesting.
Not only do I see Fixture
and createFixture
, but I also have all of the default generators.
Did you install a previous version or is this a fresh copy of zod-fixture@2.1.0
?
Also, what version of Typescript are you using?
Maybe include your tsconfig as well.
I'm pretty sure this is linked to our use of wildcard exports but without additional information I can't reproduce.
// public.ts
export * from '@/fixture'; // <-- for some reason, your environment doesn't like this
export { Generator } from '@/transformer/generator';
export {
ConstrainedTransformer,
Transformer,
UnconstrainedTransformer,
} from '@/transformer/transformer';
👋 also ran into this issue on "typescript": "^5.1.6"
but upgrading to "zod-fixture": "^2.1.3"
solved the issue.
Closing this issue, feel free to reopen with a reproduction.
Reproduced here, TS version 5.2.2, zod-fixture version 2.5.0
https://github.com/significantotter/zod-fixture-import-error
Reproduced here, TS version 5.2.2, zod-fixture version 2.5.0
https://github.com/significantotter/zod-fixture-import-error
@significantotter take a look at https://www.totaltypescript.com/relative-import-paths-need-explicit-file-extensions-in-ecmascript-imports . Do you need to be on "NodeNext" ?
Reproduced here, TS version 5.2.2, zod-fixture version 2.5.0 https://github.com/significantotter/zod-fixture-import-error
@significantotter take a look at https://www.totaltypescript.com/relative-import-paths-need-explicit-file-extensions-in-ecmascript-imports . Do you need to be on "NodeNext" ?
Sorry for the delay in responding! Been a busy week with the holiday. I have done an insane amount of trial and error with ts import paths and build targets. It feels like every tool like knex or jest or vitest or discord.js have different configurations that are or are not valid, and NodeNext ends up being pretty much the only module resolution setting that I can get to properly work with all my tooling. Furthermore, NodeNext is the recommended module resolution by typescript, and the default for a tsconfig. So I imagine that I won't be the only one running into this issue. The ts config docs recommend against using anything other than nodenext/node16 for most purposes.
In fact, the official ts docs go so far as to say:
node16 and nodenext are the only correct module options for all apps and libraries that are intended to run in Node.js v12 or later, whether they use ES modules or not.
:tada: This issue has been resolved in version 2.5.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@significantotter thanks for bringing this to my attention again (and thanks for the reproduction!) because I forgot about it. v2.5.1 should fix this problem.
On zod-fixture@2.1.0 it seems like neither
Fixture
norcreateFixture
are exported from the TypeScript definitions.