Serverless Bundle Loader Issue
Closed this issue · 4 comments
Hello guys,
I'm using easypost
with serveless-bundle
and I'm getting multiple errors like this:
ERROR in .../node_modules/@easypost/api/src/resources/apiKey.js 13:21
Module parse failed: Unexpected token (13:21)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| export default api => (
| class ApiKey extends base(api) {
> static propTypes = propTypes;
| static _name = 'ApiKey';
| static _url = 'api_keys';
serverless-bundle
is using Webpack Raw Loader
which should be enough to load the file. (https://www.npmjs.com/package/serverless-bundle#support-for-pem-txt-and-other-raw-files)
Any ideas?
Do you need to pull in a different transpiled version of the library? I'm not at all familiar with serverless-bundle
, but I believe our default babel build targets node8+, so if you are running against an older parser you may need to pull in the babel-ized node6 version.
@itoure were you able to get this resolved or is this still something you need help with?
I looked into this a bit but would probably need more info to pursue a solution. Do you have a link to your project you can share here or additional details such as your webpack config or package.json
?
Additionally, the Webpack Raw Loader looks like it is for pem
or txt
files which these aren't and may be a red herring. It looks like serverless-bundle can handle JS and JSON out of the box.
After looking into this some, I believe it's an issue with how serverless-bundle
is setup. If you have additional details to provide that could help us further assist you, please share them here and reopen this issue.