Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psc-bundle is unable to parse module when purescript-spec is installed #12

Closed
ghost opened this issue Aug 2, 2015 · 6 comments
Closed

Comments

@ghost
Copy link

ghost commented Aug 2, 2015

psc-bundle (and pulp build with the --to flag) gives me the error The module could not be parsed. whenever Test.Spec.* modules have been built to the output directory. When I delete those directories, I am able to bundle. Any idea what's causing this?

@owickstrom
Copy link
Collaborator

Hmm, not able to recreate this. Could you provide a minimal project and list the commands you're running? Which versions of purescript-spec, psc and pulp are you using?

Thanks!

@ghost
Copy link
Author

ghost commented Aug 3, 2015

Sure, here's output from my shell; let me know if you need any more info:

==> mkdir example

==> cd example

==> pulp -v
4.3.0

==> psc --version
0.7.0.0

==> pulp init
[installations elided]

==> pulp build --to out.js
* Building project in /Users/am/w/example2
* Build successful.
* Bundling Javascript...
* Bundled.

==> node out.js
Hello sailor!

==> rm -f out.js

==> pulp dep i purescript-spec
[installations elided]

==> pulp build --to out.js
* Building project in /Users/am/w/example2
* Build successful.
* Bundling Javascript...
The module could not be parsed.

* ERROR: Subcommand terminated with error code 1

==> psc-bundle output/**/*.js --module Main --main Main > out.js
The module could not be parsed.

==> rm -rf output/Test.Spec*

==> psc-bundle output/**/*.js --module Main --main Main > out.js

==> node out.js
Hello sailor!

@owickstrom
Copy link
Collaborator

Thank you!

It seems that the escape sequence at https://github.com/owickstrom/purescript-spec/blob/12ee764274c0900c4f8167dd2ecb2b5f815a9280/src/Test/Spec/Console.purs#L22 gets interpreted during the PS -> JS compilation. The module in output/ contains the unescaped character which causes the bundle to fail. I'll try to move the string literal with the escape to a foreign function and see if that works.

Related issues: purescript/purescript#1265 and purescript/purescript#1266

@owickstrom
Copy link
Collaborator

I did a workaround for this and released a new version 0.7.1. Please let me know if it works out.

Thanks for your feedback!

@ghost
Copy link
Author

ghost commented Aug 3, 2015

The new version works - thank you!

@ghost ghost closed this as completed Aug 3, 2015
@michaelficarra
Copy link
Contributor

FYI purescript/purescript#1265 is fixed now!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants