Open jpiat opened 4 years ago
Found a quick/dirty fix. Once the package is generated, use the following on-liner in the package folder
find ./src -type f -name *.js -exec sed -i "s/define.amd/false/g" {} \;
this will disable the if statement that causes the issue.
Description
I am trying to use a javascript package, generated through swagger editor, in a react application and i get the following error :
"Cannot find module: 'ApiClient'. Make sure this package is installed."
the error is generated when react builds the sr/index.js file of the package.
the package works fine when used with browserify.
Swagger-codegen version
The version used is the one used by swagger-editor latest release : 2.4.15
Swagger declaration file content or url
The yaml content does not trigger a code generation error. Only the generated code does not seem to be compatible with react
Command line used for generation
Generated through swagger-editor
Steps to reproduce
Generate any package and try to bundle in a react aplpication
Related issues/PRs
Suggest a fix/enhancement