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

Not working with react next js #13

Closed
trompx opened this issue Apr 2, 2021 · 6 comments
Closed

Not working with react next js #13

trompx opened this issue Apr 2, 2021 · 6 comments

Comments

@trompx
Copy link

trompx commented Apr 2, 2021

Hello,

I was using an old version of splittype and recently migrated to next js.
I tried to use your new version import SplitType from 'split-type' but I get the following error:

Server Error
SyntaxError: Unexpected token 'export'

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
external%20%22split-type%22 (1:0) @ eval

> 1 | module.exports = require("split-type");

Any idea how to solve this?

@lukePeavey
Copy link
Owner

Did you install the latest version of split-type?

@lukePeavey
Copy link
Owner

@trompx sorry it took me a few days to respond

Just tested split-type with Next js, I am getting the same error.

@lukePeavey
Copy link
Owner

lukePeavey commented Apr 5, 2021

I just released a patch version v0.2.5 that fixes this issue.

I've tested it with Next JS and it seems to be working fine now. Here is a CodeSandbox Example with next and split-type@0.2.5.

@lukePeavey
Copy link
Owner

I'm going to close this now since it's been resolved.

@trompx I'm not sure if you saw my previous comment, but this issue was fixed in version 0.2.5. Once you upgrade to the new version, SplitType should work fine with Next.js. If you are still having problems after upgrading to 0.2.5, let me know and I'll reopen this.

@trompx
Copy link
Author

trompx commented May 11, 2021

So sorry for answering this late, I've been caught by other projects. It works wonder now, no more errors, thanks !

@lukePeavey
Copy link
Owner

Great, glad to hear it!

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

No branches or pull requests

2 participants