bug: Unexpected character '#' on build
See original GitHub issueDescribe the bug
Bundling via webpack
(via netlify-lambda
) fails with the following error:
ERROR in ../node_modules/@panva/jose/lib/jws/sign.js 14:2
Module parse failed: Unexpected character '#' (14:2)
(Detailed stack trace at the end of this post.)
It appears that webpack barfs at this kind of syntax with the #
class Sign {
#b64
#payload
#recipients
...
I’m submitting an issue here because ‘#’ appears to be invalid syntax.
To Reproduce
Steps to reproduce the behaviour:
git clone https://github.com/rendall/jwt-implementation/tree/%40panva/jose
cd ./jwt*
or otherwise into project directorynpm / yarn install
npm / yarn run build
Expected behaviour
That there be no Unexpected character
error.
Environment:
- @panva/jose version:
1.0.0
- node version:
v12.0.0
Additional context Add any other context about the problem here.
- the bug is happening on latest @panva/jose too.
- i have tried DEBUG (see readme.md) and can see the issue is with the provider and not my code.
- i have searched the issues tracker on github for similar issues and couldn’t find anything related.
Detailed Error stack trace
netlify-lambda: Building functions
Hash: c3ac99528bc9843d63e5
Version: webpack 4.30.0
Time: 2110ms
Built at: 04/27/2019 7:55:37 AM
Asset Size Chunks Chunk Names
auth.js 124 KiB 0 auth
Entrypoint auth = auth.js
[0] external "crypto" 42 bytes {0} [built]
[2] ../node_modules/@panva/jose/lib/errors.js 275 bytes {0} [built] [failed] [1 error]
[5] ../node_modules/@panva/jose/lib/jwk/key/base.js 5.89 KiB {0} [built]
[10] ../node_modules/@panva/jose/lib/jwks/keystore.js 202 bytes {0} [built] [failed] [1 error]
[16] ../node_modules/@panva/jose/lib/jwk/generate.js 1.5 KiB {0} [built]
[18] ../node_modules/@panva/jose/lib/jws/index.js 525 bytes {0} [built]
[31] ../node_modules/@panva/jose/lib/jwk/index.js 298 bytes {0} [built]
[37] ../node_modules/@panva/jose/lib/index.js 178 bytes {0} [built]
[38] ../node_modules/dotenv/lib/main.js 2.87 KiB {0} [built]
[39] ./auth.js 3.21 KiB {0} [built]
[40] ../node_modules/@panva/jose/lib/jwe/index.js 570 bytes {0} [built]
[85] ../node_modules/@panva/jose/lib/jwks/index.js 70 bytes {0} [built]
[89] ../node_modules/@panva/jose/lib/jwt/index.js 150 bytes {0} [built]
[92] external "fs" 42 bytes {0} [built]
[93] external "path" 42 bytes {0} [built]
+ 79 hidden modules
ERROR in ../node_modules/@panva/jose/lib/jws/sign.js 14:2
Module parse failed: Unexpected character '#' (14:2)
You may need an appropriate loader to handle this file type.
|
| class Sign {
> #b64
| #payload
| #recipients
@ ../node_modules/@panva/jose/lib/jws/index.js 1:13-30
@ ../node_modules/@panva/jose/lib/index.js
@ ./auth.js
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Error of build because of the error Module parse failed
I have trouble related to Unexpected character of node module file. Here is my next.config.js file /** * @type {import('next').
Read more >error CS1056: Unexpected character - Visual Studio Feedback
While using TFS 2017, I created a build that runs 1 test and I get this error from a couple of libraries that...
Read more >Bug - [Burst] Error CS1056: Unexpected Character - Unity Forum
Bug [Burst] Error CS1056: Unexpected Character' ... I just started a new project and I get this every time I create a new...
Read more >Fontsource Error - Unexpected character '@' - Roots Discourse
build.rules.css.setInclude([app.path()]);. Try to load modules from the source directory or the node_modules ...
Read more >Error During ionic Build Module parse Unexpected Character
suddenly all of my project are having this error when i build with ionic build --prod please can anybody help.
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
Then don’t transpile
@panva/jose
dependency until your tooling is ready to recognize the new javascript syntax.I’ve made @panva/jose compatible with lts/dubnium, it is now being tested with Node.js
^10.13.0 || >=12.0.0
and Electron^6.0.0
It is not without caveats, but they are acceptable.