mb21 / panwriter

Markdown editor with pandoc integration and paginated preview.
https://PanWriter.com
GNU General Public License v3.0
1.01k stars 46 forks source link

Building from source on Windows 10 produces 2 errors #92

Open shaneknysh opened 2 years ago

shaneknysh commented 2 years ago

Building from source on windows throws 2 errors.

First yarn install

[4/4] Building fresh packages...
$ cp node_modules/pagedjs/dist/paged.polyfill.js public && cp -r node_modules/katex/dist/ public/katex && cp node_modules/markdown-it-texmath/css/texmath.css public/katex
'cp' is not recognized as an internal or external command,
operable program or batch file.

I edited the package.json replacing cp with copy but received a different error. I reverted and ran the command via WSL

Second yarn dist

$ INLINE_RUNTIME_CHUNK=false react-scripts build
'INLINE_RUNTIME_CHUNK' is not recognized as an internal or external command, 'INLINE_RUNTIME_CHUNK' is not recognized as an internal or external command

Any advice would be appreciated.

mb21 commented 2 years ago

Hello! Yes, WSL seems the right way to go... I'm surprised it doesn't work out of the box... are you using WSL 2.0? which shell does it have? bash, or?

This:

INLINE_RUNTIME_CHUNK=false react-scripts build

simply sets the INLINE_RUNTIME_CHUNK environment variable when running the command react-scripts build, but seems the shell you're running in doesn't know that syntax...

shaneknysh commented 2 years ago

I have tried it in powershell, cmd, windows terminal (which is running powershell) and bash (WSL). It works running under bash but it doesn't generate a windows executable and the -mlw flag throws new errors related to the macOS build.

I am testing my css changes and it works the way I like it but hte build process it run part in bash, then manually change some commands and copy files then run dist in powershell.I was hoping changing cp to copy would solve the first part but it hasen't. I have the INLINE_RUNTIE_CHUNK errorI have it 95% solved using a cross-env package. I will push an update (minus my css changes) and request a PR once I have it the rest of the way there.

then try to add the css changes to the option screen and request a new PR for that.

On Tue, 18 Jan 2022 at 00:46, Mauro Bieg @.***> wrote:

Hello! Yes, WSL seems the right way to go... I'm surprised it doesn't work out of the box... are you using WSL 2.0? which shell does it have? bash, or?

This:

INLINE_RUNTIME_CHUNK=false react-scripts build

simply sets the INLINE_RUNTIME_CHUNK environment variable when running the command react-scripts build, but seems the shell you're running in doesn't know that syntax...

— Reply to this email directly, view it on GitHub https://github.com/mb21/panwriter/issues/92#issuecomment-1015147439, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABGVGIVAKH3THA7X3DDJU3UWULEHANCNFSM5MFXQ5KQ . You are receiving this because you authored the thread.Message ID: @.***>

mb21 commented 2 years ago

I have the INLINE_RUNTIE_CHUNK errorI have it 95% solved using a cross-env package

that sounds promising! INLINE_RUNTIE_CHUNK is for https://create-react-app.dev/docs/advanced-configuration/

then try to add the css changes to the option screen and request a new PR for that.

let's discuss/track that in https://github.com/mb21/panwriter/issues/93

shaneknysh commented 2 years ago

I added the cross env package as a dev dependency and changed the command to

"build": "cross-env INLINE_RUNTIME_CHUNK=false react-scripts build",

it fixes the INLINE_RUNTIME_CHUNK error - but I can't test the mac build or -mlw flag.

still working on the cp/copy error, I will work on it this weekend and hopefully have a PR ready.