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

Exported identifiers must be unique #1366

Open
jigsawye opened this issue Oct 3, 2023 · 2 comments
Open

Exported identifiers must be unique #1366

jigsawye opened this issue Oct 3, 2023 · 2 comments
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided platform: next.js 🛠️ Issue related to next.js platform: ssr 🛠️ Issue related to SSR

Comments

@jigsawye
Copy link

jigsawye commented Oct 3, 2023

Environment

  • Linaria version: 5.0.3
  • Bundler (+ version): 5.88.0
  • Node.js version: v18.16.1
  • OS: macOS 14.0

Description

Error: 
  x the name `init` is exported multiple times
   ,-[**/dist/browser/index.js:1:1]
 1 | export { _SENTRY_SDK_MULTIPLEXER, init, withSentryConfig, nextRouterInstrumentation, captureUnderscoreErrorException, withSentryGetStaticProps, wrapGetStaticPropsWithSentry, withSentryServerSideGetInitialProps, wrapGetInitialPropsWithSentry, withSentryServerSideAppGetInitialProps, wrapAppGetInitialPropsWithSentry, withSentryServerSideDocumentGetInitialProps, wrapDocumentGetInitialPropsWithSentry, withSentryServerSideErrorGetInitialProps, wrapErrorGetInitialPropsWithSentry, withSentryGetServerSideProps, wrapGetServerSidePropsWithSentry, wrapServerComponentWithSentry, wrapRouteHandlerWithSentry, wrapApiHandlerWithSentryVercelCrons, wrapMiddlewareWithSentry, BrowserTracing, Integrations, init, Profiler, useProfiler, withProfiler, ErrorBoundary, withErrorBoundary, createReduxEnhancer, reactRouterV3Instrumentation, reactRouterV4Instrumentation, reactRouterV5Instrumentation, withSentryRouting, reactRouterV6Instrumentation, withSentryReactRouterV6Routing, wrapCreateBrowserRouter, wrapUseRoutes, Integrations, FunctionToString, Hub, InboundFilters, ModuleMetadata, SDK_VERSION, Scope, addBreadcrumb, addGlobalEventProcessor, addTracingExtensions, captureEvent, captureException, captureMessage, close, configureScope, createTransport, extractTraceparentData, flush, getActiveSpan, getActiveTransaction, getCurrentHub, getHubFromCarrier, lastEventId, makeMain, makeMultiplexedTransport, setContext, setExtra, setExtras, setMeasurement, setTag, setTags, setUser, spanStatusfromHttpCode, startInactiveSpan, startSpan, startSpanManual, startTransaction, trace, withScope, WINDOW, BrowserClient, makeFetchTransport, makeXHRTransport, chromeStackLineParser, defaultStackLineParsers, defaultStackParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser, eventFromException, eventFromMessage, exceptionFromError, createUserFeedbackEnvelope, captureUserFeedback, defaultIntegrations, forceLoad, init, onLoad, showReportDialog, wrap, Replay, BrowserTracing, defaultRequestInstrumentationOptions, instrumentOutgoingRequests, makeBrowserOfflineTransport, onProfilingStartRouteTransaction, BrowserProfilingIntegration, GlobalHandlers, TryCatch, Breadcrumbs, LinkedErrors, HttpContext, Dedupe } from "@sentry/nextjs"; //# sourceMappingURL=index.js.map
   :                                   ^^|^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ^^|^
   :                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   `-- exported more than once
   :                                     `-- previous exported here
   `----

I believe it's because in @sentry/nextjs, after using export * from '@sentry/node', they also export the init function, which is causing this error.

https://github.com/getsentry/sentry-javascript/blob/develop/packages/nextjs/src/server/index.ts#L15

Reproducible Demo

In my case, simply reexporting @sentry/nextjs results in this error.

https://codesandbox.io/p/sandbox/tender-sea-gqsymt

@jigsawye jigsawye added bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided needs: triage 🏷 Issue needs to be checked and prioritized labels Oct 3, 2023
@github-actions github-actions bot added bundler: webpack 📦 Issue is related to webpack bundler platform: next.js 🛠️ Issue related to next.js platform: ssr 🛠️ Issue related to SSR and removed needs: triage 🏷 Issue needs to be checked and prioritized bundler: webpack 📦 Issue is related to webpack bundler labels Oct 3, 2023
@layershifter
Copy link
Contributor

Can you please provide a repro case on Stackblitz or in Github repo?

@jigsawye
Copy link
Author

Hi @layershifter,

Here is the reproduction of this bug: https://codesandbox.io/p/sandbox/tender-sea-gqsymt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided platform: next.js 🛠️ Issue related to next.js platform: ssr 🛠️ Issue related to SSR
Projects
None yet
Development

No branches or pull requests

2 participants