[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:
Webpack gives a warning while bundling a Typescript file importing from the Alexa SDK
## Expected Behavior
Webpack runs without warning
## Current Behavior
Webpack gives a warning:
WARNING in ./node_modules/ask-sdk-core/dist/util/AskSdkUtils.js 34:22-67 Critical dependency: the request of a dependency is an expression @ ./node_modules/ask-sdk-core/dist/util/AskSdkUtils.js @ ./node_modules/ask-sdk-core/dist/attributes/AttributesManagerFactory.js @ ./node_modules/ask-sdk-core/dist/index.js @ ./node_modules/ask-sdk/dist/index.js @ ./impfkompass.ts
Running the output results in:
Error -------------------------------------------------- 聽聽Cannot find module "." 聽聽聽聽聽For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable. 聽聽Stack Trace -------------------------------------------- Error: Cannot find module "." 聽聽聽聽at webpackMissingModule (/Users/johanneskees/Repositories/a7/impfkompass-alexa-node/.webpack/service/impfkompass.js:1768:67) 聽聽聽聽at Object.createAskSdkUserAgent (/Users/johanneskees/Repositories/a7/impfkompass-alexa-node/.webpack/service/impfkompass.js:1768:145) 聽聽聽聽at Skill.(/Users/johanneskees/Repositories/a7/impfkompass-alexa-node/.webpack/service/impfkompass.js:6632:58) 聽聽聽聽at step (/Users/johanneskees/Repositories/a7/impfkompass-alexa-node/.webpack/service/impfkompass.js:6568:23) 聽聽聽聽at Object.next (/Users/johanneskees/Repositories/a7/impfkompass-alexa-node/.webpack/service/impfkompass.js:6549:53) 聽聽聽聽at fulfilled (/Users/johanneskees/Repositories/a7/impfkompass-alexa-node/.webpack/service/impfkompass.js:6540:58) 聽聽聽聽at ...
Remove usage of path.* in require calls
Webpack Conf:
const path = require('path');
const slsw = require('serverless-webpack');
module.exports = {
entry: slsw.lib.entries,
devtool: 'source-map',
resolve: {
extensions: [
'.js',
'.jsx',
'.json',
'.ts',
'.tsx'
]
},
output: {
libraryTarget: 'commonjs',
path: path.join(__dirname, '.webpack'),
filename: '[name].js',
},
target: 'node',
module: {
loaders: [
{ test: /\.ts(x?)$/, loader: 'ts-loader' },
],
},
};
TS Config:
{
"compilerOptions": {
"sourceMap": true,
"lib": [
"es5",
"es2015.promise",
"es6"
]
}
}
Do you have an idea when this might be resolved? This blocks building skills with webpack using the new SDK. Is it really needed to add the version to the user-agent and therefore parse the package.json?
Hey folks just wondering when this may be resolved as I'm hitting serious issues with this, cannot ship a skill.
Is there a chance that you release this as a new version?
+1 I'm running into the same issue. Please fix.
My webpack build zip file is 518kb. Without webpack it's 5.8MB. In a situation where I'm constantly uploading and re-uploading a zip file to test changes this makes a significant impact on my workflow.
I haven't benchmarked this and could certainly be wrong, but I would also expect a small built file to execute more efficiently on lambda as well since it's not touching the filesystem.
@eileennoonan83 This issue was fixed in v2.0.4, just update and you can continue using webpack!
@captnCC Thank you! Seems to be working now :D
Most helpful comment
Is there a chance that you release this as a new version?