Skip to content
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

Webpack Compilation Failed #116

Open
simonphughes opened this issue Mar 16, 2023 · 2 comments
Open

Webpack Compilation Failed #116

simonphughes opened this issue Mar 16, 2023 · 2 comments

Comments

@simonphughes
Copy link

I have a typescript v3 project, and i have tried following the instructions by adding in the add-in.

If I run the sls generate-swagger command then it creates me a swagger directory, but if i try and deploy normally then i get the following webpack error:
in ./swagger/swagger-json.js 3:16-36
Module not found: Error: Can't resolve './swagger' in 'C:\myfolderstructure\swagger'
resolve './swagger' in 'C:\myfolderstructure\swagger'
using description file: C:\myfolderstructure\package.json (relative path: ./swagger)
using description file: C:\myfolderstructure\package.json (relative path: ./swagger/swagger)
no extension
C:\myfolderstructure\swagger\swagger doesn't exist
.mjs
C:\myfolderstructure\swagger\swagger.mjs doesn't exist
.json
C:\myfolderstructure\swagger\swagger.json doesn't exist
.ts
C:\myfolderstructure\swagger\swagger.ts doesn't exist
js
C:\myfolderstructure\swagger\swaggerjs doesn't exist
as directory
C:\myfolderstructure\swagger\swagger doesn't exist

Any help much appreciated.

@lmanerich
Copy link

Same problem. Removing serverless-webpack from plugins list solves the issue.

@lmanerich
Copy link

Hey @simonphughes I manage to solve the issue by adding *.js to the webpack configuration:

module.exports = {
    resolve: {
        extensions: ['.mjs', '.json', '.ts', '.js'],
        symlinks: false,
        cacheWithContext: false
    },
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants