GithubHelp home page GithubHelp logo

Comments (5)

aldegoeij avatar aldegoeij commented on June 4, 2024

If I add:

import Amplify from "aws-amplify"
import awsconfig from "./../aws-exports"
import { withAuthenticator } from "aws-amplify-react" 
Amplify.configure(awsconfig)

Without any actual use, the build-html step of Gatsby crashes with a very weird error:

Error: /Users/alexander/Projects/bodycode/www/public/render-page.js:74355
      {}.DEBUG = namespaces;
        ^
  SyntaxError: Unexpected token .

Referring to render-page.js snippet:

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */

function save(namespaces) {
  if (null == namespaces) {
    // If you set a process.env field to null or undefined, it gets cast to the
    // string 'null' or 'undefined'. Just delete instead.
    delete {}.DEBUG;
  } else {
    {}.DEBUG = namespaces;
  }
}

Is there some kind of expected environment variable that is missing that is causing this?
I have no idea how to go about debugging this...

from gatsby-auth-starter-aws-amplify.

aldegoeij avatar aldegoeij commented on June 4, 2024

the bug I'm talking about here is worked-around using escaladesports/legacy-gatsby-plugin-prefetch-google-fonts#18 and actually related to debug library used as dependency of gatsby.

So you can close the error part of this issue.

Still wondering why you didn't use the HOC though 😄

from gatsby-auth-starter-aws-amplify.

dabit3 avatar dabit3 commented on June 4, 2024

Hey, thanks for the issue! I'm not using withAuthenticator because many people want to have custom control over their auth, so I created this project. I would also suggest using withAuthenticator if it suits your needs though.

from gatsby-auth-starter-aws-amplify.

dabit3 avatar dabit3 commented on June 4, 2024

Also, I've updated the dependencies and upgraded the Gatsby project, this should work now. @aldegoeij

from gatsby-auth-starter-aws-amplify.

rob94p avatar rob94p commented on June 4, 2024

how would you access the users data after withAuthenticator() has been called and the Auth.currentAuthenticatedUser() has been called. lets say i was using withAuthenticator() to protect a profile page ... as soon as the user is authenticated the profile page will be accessible but the data from that user data is not able to be accessed before that profile page is displayed.

from gatsby-auth-starter-aws-amplify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.