Latest wasm build doesn't work with latest wasm_execs
LaserKaspar opened this issue · comments
Thank you for submitting a possible bug!
Please ensure the following:
- Your issue is based on the latest commit
- State your OS and OS version
- When reporting a problem with a specific PDF input file please avoid stating the organization responsible for the PDFWriter - just refer to the PDFWriter
Latest Commit: Yes
OS: Windows 10 19045.4239
Bug Description
When running any command with arguments, I get the following error:
pdfcpu: config dir problem: permissions is numeric, got: 0xF0C3
I tried using the released wasm module as well as compiling myself. Both produce the same error.
Steps to reproduce
In Node:
node wasm_exec_node.js pdfcpu.wasm version
In Browser:
node static_server.js
-> Open (http://localhost:8888/wasm_exec.html)[http://localhost:8888/wasm_exec.htm]) -> Open Browser Console -> Press Run Button
Expected Output:
pdfcpu: config dir problem: permissions is numeric, got: 0xF0C3
MemFS does not cause the issue, same error can be produced without MemFS using the unmodified wasm_exec.js or wasm_exec_node.js.
Thanks for your help!
Sorry I am not a WASM expert.
@henrixapp can you help out?
Hi,
I am a little bit out of the loop. But here are my thoughts:
This issue seams very similar to #231 and #232.
The error seems to be caused by trying to load/open a config file around here
pdfcpu/pkg/pdfcpu/model/configuration.go
Line 361 in 6e48669
This config file will not exist/be openable in WASM env for security reasons.
I would propose to set
pdfcpu/pkg/pdfcpu/model/configuration.go
Line 255 in 6e48669
api.DisableConfigDir()
on wasm target. This can be done using build tags.
Best
Henrik