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

purescript-maps: Unexpected token #6

Closed
garyb opened this issue Jan 10, 2017 · 17 comments
Closed

purescript-maps: Unexpected token #6

garyb opened this issue Jan 10, 2017 · 17 comments

Comments

@garyb
Copy link

garyb commented Jan 10, 2017

Due to delete https://github.com/purescript/purescript-maps/blob/c673935784492b5f181bdf392944d4c8245028a9/src/Data/StrMap/ST.purs#L10:

2: var peek = $foreign.peekImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
3: export { peek };
4: export { delete } from "./foreign";
            ^
5: export { new } from "./foreign";
6: export { poke } from "./foreign";
@garyb garyb changed the title purescript-st: Unexpected token purescript-maps: Unexpected token Jan 10, 2017
@Pauan
Copy link
Owner

Pauan commented Jan 10, 2017

This is a known bug in acorn, which was fixed, so we just need to wait for acorn to publish a new version to npm.

@Pauan Pauan closed this as completed Jan 10, 2017
@Pauan
Copy link
Owner

Pauan commented Feb 4, 2017

@garyb acorn@4.0.8 has been released, please upgrade to the latest version of rollup and rollup-plugin-purs and then try again.

Note: you don't need to use rollup-plugin-node-resolve anymore, unless you want to bundle npm modules (from node_modules).

@garyb
Copy link
Author

garyb commented Feb 4, 2017

The problem persists. acorn doesn't seem to be present at all in node_modules though, so it seems a little odd if that was the problem?

@Pauan
Copy link
Owner

Pauan commented Feb 4, 2017

@garyb What's your version of rollup and rollup-plugin-purs? And does the problem still happen even after completely deleting node_modules and re-running npm install?

@garyb
Copy link
Author

garyb commented Feb 4, 2017

rollup 0.41.4, rollup-plugin-purs 1.0.16. And yes, I deleted node_modules and tried again when it didn't work the first time. I also spent a while removing anything from my global node_modules that could possibly be interfering, even though that shouldn't make a difference.

@Pauan
Copy link
Owner

Pauan commented Feb 4, 2017

@garyb Ahh, I see the problem. Rollup is deployed as a bundle, and so it bundles all of its dependencies (including acorn).

So even though the problem was fixed in acorn, Rollup needs to be re-bundled and re-published, so we now need to wait for Rollup to release a new version.

I'll leave this issue open until we've verified that it's fixed.

@Pauan Pauan reopened this Feb 4, 2017
@garyb
Copy link
Author

garyb commented Feb 4, 2017

Here's a minimal example: https://github.com/garyb/purs-rollup-test.

@garyb
Copy link
Author

garyb commented Feb 4, 2017

Ah ok!

@Cmdv
Copy link

Cmdv commented Mar 27, 2017

Just tried this out again today with latest version of rollup and still the same error 😞

@Pauan
Copy link
Owner

Pauan commented Mar 28, 2017

Yeah, it seems that Rollup hasn't been updated yet. I pinged them, so hopefully it'll get fixed soon.

@Cmdv
Copy link

Cmdv commented Mar 28, 2017

Thanks @Pauan

Pauan added a commit that referenced this issue Apr 11, 2017
@Pauan
Copy link
Owner

Pauan commented Apr 11, 2017

@garyb @Cmdv Okay, it's been 26 days since Rollup was last updated, and it doesn't look like it's going to be fixed anytime soon.

So I put in a temporary hacky workaround which fixes this issue. Please upgrade to 1.0.37 and try again.

@Pauan Pauan closed this as completed Apr 11, 2017
@Cmdv
Copy link

Cmdv commented Apr 11, 2017

Cool thanks @Pauan will give it a try and report back 😄

@garyb
Copy link
Author

garyb commented Apr 15, 2017

Cool, the plugin almost works for SlamData now 😆

@Pauan
Copy link
Owner

Pauan commented Apr 15, 2017

@garyb Bug reports welcome. 👍 Ideally I would like all existing PureScript programs to work with rollup-plugin-purs

@garyb
Copy link
Author

garyb commented Apr 15, 2017

Sure, it's a problem in one of the npm dependencies really (duplicate export), thought I'd look into that first.

@Pauan
Copy link
Owner

Pauan commented Apr 15, 2017

@garyb In that case I should be able to fix that pretty easily, I'll try to get a fix pushed out soon.

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

3 participants