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

How to use with NextJS + typescript? #795

Open
MaxmaxmaximusAWS opened this issue Jul 2, 2021 · 5 comments
Open

How to use with NextJS + typescript? #795

MaxmaxmaximusAWS opened this issue Jul 2, 2021 · 5 comments
Labels
cat: typings 👮 Typescript types related issues enhancement: proposal 💬 Improvement of current behaviour that needs to be discussed platform: next.js 🛠️ Issue related to next.js

Comments

@MaxmaxmaximusAWS
Copy link

How to use with NextJS + typescript?

@MaxmaxmaximusAWS MaxmaxmaximusAWS added the enhancement: proposal 💬 Improvement of current behaviour that needs to be discussed label Jul 2, 2021
@github-actions github-actions bot added platform: next.js 🛠️ Issue related to next.js cat: typings 👮 Typescript types related issues labels Jul 2, 2021
@hyoretsu
Copy link

hyoretsu commented Jul 3, 2021

In the meantime, install these:

yarn add @linaria/core @linaria/react
yarn add -D @linaria/babel-preset @linaria/shaker @linaria/webpack-loader next-linaria@1.0.0-beta

Note: you have to install the beta for next-linaria, otherwise you'll need to install the linaria package (kinda old version) instead of those 5 and do a slightly different setup.
Then add this to your babel config: presets: ['@linaria'] and wrap your next.config.js options with the default export from next-linaria withLinaria()

A more hands-on example from a package of mine: https://github.com/hyoretsu/aufklarung-site

@Gabriel-Alves-Cunha
Copy link

Hey, @hyoretsu, how did you solve the issue of Error: Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!? Or did you not get it at all?

@hyoretsu
Copy link

hyoretsu commented Sep 30, 2021

Hey, @hyoretsu, how did you solve the issue of Error: Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!? Or did you not get it at all?

I didn't encounter that issue actually, maybe because of my previous setup. (working repo's in the comment above)

@Gabriel-Alves-Cunha
Copy link

Hey, @hyoretsu, how did you solve the issue of Error: Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!? Or did you not get it at all?

I didn't encounter that issue actually, maybe because of my previous setup. (working repo's in the comment above)

Hmm, I see. Thanks for responding. Guess I'm gonna have to wait for them to have a nextJS example 😗

@Anber
Copy link
Collaborator

Anber commented Oct 8, 2021

Hi @Gabriel-Alves-Cunha

I think, your problem is related to #845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat: typings 👮 Typescript types related issues enhancement: proposal 💬 Improvement of current behaviour that needs to be discussed platform: next.js 🛠️ Issue related to next.js
Projects
None yet
Development

No branches or pull requests

4 participants