Skip to content

How to find out which package eval error is coming from? #861

@evrys

Description

@evrys

Hello! I am trying to upgrade an existing nextjs app that previously ran on @cloudflare/next-on-pages to use CF Workers with this package instead. However, I am running into this:

▲ [WARNING] Using direct eval with a bundler is not recommended and may cause problems [direct-eval]

    .open-next/server-functions/default/handler.mjs:449:36391:
      449 │ ...uire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(m...

And the subsequent runtime error:

✘ [ERROR] EvalError: Code generation from strings disallowed for this context

      at [object Object]
      at e
  (file:///Users/evrys/nextjs-project/.open-next/server-functions/default/handler.mjs:351:18649)
      at s.get

I assume this is because one of my server-side dependencies is trying to use eval. But I am not sure how to find out which dependency, because the stack traces all just point at the minified build output.

Is there perhaps something opennextjs-cloudflare could do during the build process to narrow down this kind of problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions