Unexpected character '#'
See original GitHub issueThis is a Bug
Description
Using serverless-bundle
and TS code, after installing p-map
from npm, serverless-webpack
fails to bundle my code.
It appears a custom loader may be required, or some config to allow private class fields. How can I configure serverless-webpack to support this?
For bug reports:
- What went wrong?
Webpack fails with:
Serverless: Bundling with Webpack...
ERROR in /foo/bar/node_modules/aggregate-error/index.js 7:1
Module parse failed: Unexpected character '#' (7:1)
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 class AggregateError extends Error {
> #errors;
|
| name = 'AggregateError';
@ /foo/bar/node_modules/p-map/index.js 1:0-45 42:17-31
@ /foo/bar/src/operations/utils.ts
@ /foo/bar/src/operations/index.ts
@ /foo/bar/src/api.ts
@ /foo/bar/src/index.ts
Error ---------------------------------------------------
Error: Webpack compilation error, see stats above
at /foo/bar/node_modules/serverless-webpack/lib/compile.js:37:15
- What did you expect should have happened?
Complication success
- What was the config you used?
bundle:
sourceMaps: true
packager: yarn
linting: true
package.json:
"dependencies": {
"p-map": "^5.0.0"
}
- What stacktrace or error message from your provider did you see?
Module parse failed: Unexpected character '#' (7:1)
Similar or dependent issue(s):
Additional Data
- Serverless-Webpack Version you’re using: 5.50
- Webpack version you’re using: 4.46.0
- Serverless Framework Version you’re using: 2.41.1
- Operating System: Ubuntu 18.04
- Stack Trace (if available): See above
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Unexpected Character - TV Tropes
They could be a One-Scene Wonder, someone who had succumbed to Chuck Cunningham Syndrome, simply a Living Prop, a Joke Character, or even...
Read more >1:1 error Parsing error: Unexpected character ' ' - Stack Overflow
It look like UTF-8 BOM in the begin of your file. If you have notepad++ you can remove it by click to "Encoding"...
Read more >ParseError: Unexpected character '@' #15832 - GitHub
I'm getting this parsing error (i.e., error Unexpected character '@' ParseError ) returned when running eslint --cache --fix .
Read more >Unexpected character encountered while parsing value
Unexpected character encountered while parsing value: P. Path '', line 0, position 0. Question. Reactive. API. Application Type. Reactive.
Read more >Coach error Unexpected character 'u' on line 1, column 7984
6. Next when we run the coach service, then one of the boundary event seems to be failing with error- Unexpected character 'u'...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@j0k3r Sorry for the delay. I made a minimal PoC:
With latest stable
serverless-bundle
(4.3.1
), this fails as above. With 5.0.0-beta.2 it packages without issues. So please go ahead and close this one. Thanks for your support.@henhal can you check if it works with the beta? It’s more like a RC right now. We are confident that everything works but changing the webpack version is quite a large change.