question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serverless target for builds breaks in production

See original GitHub issue

Bug report

next dev works as expected

Describe the bug

next build fails when building dependency

ReferenceError: Blob is not defined

To Reproduce

  1. yarn add @auth0/auth0-spa-js@1.7.0
  2. Use as expected in development
  3. next build works for no target in next.config.js
  4. next build fails for target serverless

Screenshots

Error: image

image

System information

  • Version of Next.js: v9.3.5
  • Version of Node.js: v12.11.1

Additional context

Seems like a different version of @auth0/auth0-spa-js@1.7.0 is being imported for next build vs. next dev

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shicholascommented, May 6, 2020

auth0-spa-js 1.8.0 fixed this error for me

1reaction
LiborKuchejdacommented, Apr 20, 2020

I ran into a similar problem with SSR build on gatsby. Build is failing on import createAuth0Client from "@auth0/auth0-spa-js";

Possibly because “@auth0/auth0-spa-js”@“1.7.0” is referencing browser in Auth0Client constructor:

https://github.com/auth0/auth0-spa-js/blob/2fb88ce280dc87de681c9cb0d721be5d28c651a3/src/Auth0Client.ts#L120

There could be workaround: import from “auth0/auth0-spa-js” dynamically.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] serverless deploy fail through the nx plugin #55 - GitHub
First we create a package, I modified my angular.json to have this run target. npx ng run api:package # Next i run the...
Read more >
Best practices for organizing larger serverless applications
Well-designed serverless applications are decoupled, stateless, and use minimal code. As projects grow, a goal for development managers is ...
Read more >
Why local development for serverless is an anti-pattern
Developing locally when building a serverless application is not only tiresome and hard to do its actually bad for you.
Read more >
Serverless Event-Driven Systems | by Lee James Gilmore
This article aims to cover why you should have an event-driven first mindset when building out your Serverless architectures, and why Amazon EventBridge ......
Read more >
So you wanna build a Production-ready Serverless App?
So you wanna build a Production-ready Serverless App? I've been exploring serverless security for around a year now. Commonly, as a security pro ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found