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

syntax error trying to define a Primer wrapper component #21

Open
jaked opened this issue May 9, 2024 · 0 comments
Open

syntax error trying to define a Primer wrapper component #21

jaked opened this issue May 9, 2024 · 0 comments

Comments

@jaked
Copy link
Collaborator

jaked commented May 9, 2024

this code

import { ThemeProvider } from "@primer/react";
import { BaseStyles } from "@primer/react";

const Primer = ({ children }) => (
  <ThemeProvider>
    <BaseStyles>{children}</BaseStyles>
  </ThemeProvider>
);

produces the following error

/Users/jaked/repos/react-ts-example/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_react@18_do7p6hwz6bot7ehvwcbcc4xpfy/node_modules/@primer/react/lib-esm/index.js:2
export { default as theme } from './theme.js';
^^^^^^

SyntaxError: Unexpected token 'export'
    at internalCompileFunction (node:internal/vm:77:18)
    at wrapSafe (node:internal/modules/cjs/loader:1288:20)
    at Module._compile (node:internal/modules/cjs/loader:1340:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
    at cjsLoader (node:internal/modules/esm/translators:345:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:294:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at ViteRuntime.directRequest (file:///Users/jaked/repos/githubnext/vitale/node_modules/.pnpm/[email protected]_patch_hash=kqh4oqhknnsfnycza4ze24daba/node_modules/vite/dist/node/runtime.js:945:24)
    at ViteRuntime.cachedRequest (file:///Users/jaked/repos/githubnext/vitale/node_modules/.pnpm/[email protected]_patch_hash=kqh4oqhknnsfnycza4ze24daba/node_modules/vite/dist/node/runtime.js:914:76)
    at eval (/Users/jaked/repos/react-ts-example/deps.vnb-cellId=PhZl2Nq7iuZlloauswcKF.tsx:4:31)
    at ESModulesRunner.runViteModule (file:///Users/jaked/repos/githubnext/vitale/node_modules/.pnpm/[email protected]_patch_hash=kqh4oqhknnsfnycza4ze24daba/node_modules/vite/dist/node/runtime.js:1009:5)
    at ViteRuntime.directRequest (file:///Users/jaked/repos/githubnext/vitale/node_modules/.pnpm/[email protected]_patch_hash=kqh4oqhknnsfnycza4ze24daba/node_modules/vite/dist/node/runtime.js:990:60)
    at ViteRuntime.cachedRequest (file:///Users/jaked/repos/githubnext/vitale/node_modules/.pnpm/[email protected]_patch_hash=kqh4oqhknnsfnycza4ze24daba/node_modules/vite/dist/node/runtime.js:914:76)
    at ViteRuntime.executeUrl (file:///Users/jaked/repos/githubnext/vitale/node_modules/.pnpm/[email protected]_patch_hash=kqh4oqhknnsfnycza4ze24daba/node_modules/vite/dist/node/runtime.js:841:12)
    at _VitaleDevServer.executeCell (file:///Users/jaked/repos/githubnext/vitale/packages/server/dist/cli.js:606:35)
    at async Promise.all (index 0)
    at _VitaleDevServer.executeCellsRPC (file:///Users/jaked/repos/githubnext/vitale/packages/server/dist/cli.js:705:22)
    at WebSocket.<anonymous> (file:///Users/jaked/repos/githubnext/vitale/node_modules/.pnpm/[email protected]/node_modules/birpc/dist/index.mjs:69:20)

I think maybe we're trying to do a server-side import of code that can only be used browser-side.

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

1 participant