-
Notifications
You must be signed in to change notification settings - Fork 30
TypeScript compilation error after adding the first service - service x.validate has not exported member 'create' #37
Comments
Darn. Thanks for pointing this out. j2L3e: I added the import from serviceName.validate.?s recently. Nothing refers to the "imported" values. It works for JS but not for TS. f+/cli has been updated to generate that line commented out. We'll fix it in the next day or two. Published as f+/cli v0.7.21 using generator v0.6.20. |
The issue is TypeScript's |
The TS way would be named exports, but that would need a lot more changes |
I would go for the named exports but for backward compatibility. I assume we can go with export default moduleExports;
export const create;
...
export function validateCreate;
... which, although ugly, provides backward compatibility and lets TS use the |
j2L4e's suggestion published as f+/cli v0.7.22 using generator v0.6.21. |
Thanks for solving this issue so quickly! I solved the problem myself by exporting the moduleExports object directly like (I don't know if reopening this ticket is appropriate, but I appreciate your tools very much and would like to thank you) |
Thanks are always very appreciated. |
Steps to reproduce
feathers-plus generate options
selecting TypeScript and semicolon enabledfeathers-plus generate app
, all options to defaultnpm start
feathers-plus generate service
, all options to defaultnpm start
and the TypeScript compilation error is shownExpected behavior
I expected that Feathers was started without any problems
Actual behavior
An TypeScript compilation error occurred:
After commenting out the
import { create, update, patch, validateCreate, validateUpdate, validatePatch } from './messages.validate';
line in messages.hooks.ts, the application starts without any problems.System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
NodeJS version:
v8.11.2
Operating System: macOS 10.13.5
Browser Version:
React Native Version:
Module Loader: TypeScript 3.0.3 with ts-node 7.0.1
The text was updated successfully, but these errors were encountered: