spotlight icon indicating copy to clipboard operation
spotlight copied to clipboard

Next.js Setup Thought Dump

Open lforst opened this issue 2 years ago • 1 comments

  • Webpack plugins on Next.js are annoying to set up, I don't want to add a plugin.
  • Webpack plugin solution feels very hacky.
  • When I use the webpack plugin in Next.js I get
    rror: Cannot find module '/Users/lucaforstner/code/github/lforst/binja.io/services/next/node_modules/@spotlightjs/sidecar/src/run.js'
       at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
       at Module._load (node:internal/modules/cjs/loader:922:27)
       at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
       at node:internal/main/run_main_module:23:47 {
     code: 'MODULE_NOT_FOUND',
     require stack: []
    
    
    Package location cannot be assumed in this way because of monorepos. You need some kind of node module resolution solution (require.resolve or resolve npm module).
  • Docs tell me to do npx @spotlightjs/sidecar but how do I configure my package.json scripts to run the sidecar in parallel to my dev server? I don't really want to have to manually start the sidecar.
  • The docs should tell me how to run the sidecar programmatically, i.e. how to use setupSidecar
  • Do I call Spotlight.init() before or after Sentry.init()?
  • The spotlight landing page says nothing that this is basically an extension of the Sentry SDKs. There is nothing in the docs or the landing page that says I need the Sentry SDKs until I explicitly click on "setup" in the docs. I thought the "Thirty Seconds to Liftoff" from the landingpage was enough to get started. If I press "get started" on the landing page, I still don't see any setup related to the Sentry SDKs.
  • The docs should probably tell you to only init behind a dev environment guard if (process.env.NODE_ENV === 'development') {
  • Spotlight doesn't seem to pick up more events than the initial pageload transaction. No errors or navigation transactions.
  • If there is no side-car, it doesn't pick up anything at all. What if I just want to track my frontend errors and dont want to bother setting up a sidecar? https://github.com/getsentry/spotlight/issues/133

lforst avatar Nov 24 '23 13:11 lforst

Related: #987

BYK avatar Oct 06 '25 14:10 BYK