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

Pragma cannot be set when runtime is automatic (Nextjs) #85

Open
danieldelcore opened this issue Jul 6, 2024 · 7 comments
Open

Pragma cannot be set when runtime is automatic (Nextjs) #85

danieldelcore opened this issue Jul 6, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@danieldelcore
Copy link

image
Error: 
  × pragma cannot be set when runtime is automatic
   ╭─[/Users/foo/Development/bar/node_modules/@atlaskit/pragmatic-drag-and-drop-react-accessibility/dist/esm/drag-handle-button-base.js:1:1]
 1 │ import _extends from "@babel/runtime/helpers/extends";
 2 │ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
 3 │ var _excluded = ["children", "isSelected", "testId", "appearance", "type"];
 4 │ /** @jsx jsx */
   · ───────────────
 5 │ 
 6 │ import { forwardRef } from 'react';
   ╰────

Env:

  • React: 18
  • Nextjs: 14
@danieldelcore danieldelcore added the bug Something isn't working label Jul 6, 2024
@benjosua
Copy link

I would try to help but im not able to reproduce this, could you provide a link to a public GitHub repository or a CodeSandbox with a minimal reproduction?

@username14415
Copy link

duplicate
#67
atlassian hasn't fixed it for years, this topic is from 2022: https://community.developer.atlassian.com/t/unable-to-consume-atlaskit-in-react-18/58519

@alexreardon
Copy link
Collaborator

@danieldelcore could this be something to do with emotion? I think that component is using emotion 🤔

@danieldelcore
Copy link
Author

danieldelcore commented Jul 24, 2024

Yeah emotion was my first guess, I'm using a newer version of react via nextjs, so I'm probably running into emotion's compatibility issues with modern react. 🤔

@alexreardon
Copy link
Collaborator

Maybe your quickest option is to copy base the drag handle button and use your own styling approach

@alexreardon
Copy link
Collaborator

Let me know how you go

@lucarampi
Copy link

lucarampi commented Sep 2, 2024

As far as I researched, it's an Emotion-related issue. I had the same problem and I'm not entirely sure how I solved it, but my guess is that adding "use client" might have done the trick.

You can take a look here if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants