Skip to content

Blitz.JS Deployment: TypeError: Cannot read property '$create' of undefined #239

@jatidevelopments

Description

@jatidevelopments

I have successfully deployed BlitzJS to AWS. However, when I try to login or signup an account I get an Error:
Bildschirmfoto 2021-11-17 um 14 46 15

I think this issue is related to blitz-js/legacy-framework#13

I don't wrap the config like in the issue in 2955, so I don't get why it's not working correctly. BlitzJS is supported with this module, right?

My blitz.config.ts looks like this:

import { sessionMiddleware, simpleRolesIsAuthorized } from "blitz"
//const withPWA = require("next-pwa")

const config = {
  middleware: [
    sessionMiddleware({
      cookiePrefix: "wardrobe",
      isAuthorized: simpleRolesIsAuthorized,
    }),
  ],
 // pwa: {
  //  dest: "public",
  //  swSrc: "service-worker.js",
//    sw: "service-worker.js",
//    reloadOnOnline: true,
//    cacheOnFrontEndNav: true,
    //disable: process.env.NODE_ENV === "development",
//  },
}

module.exports = config

Maybe it has something to do with the next-tf package. I found in "terraform-aws-next-js/packages/tf-next/src/utils/index.ts" that its parsing for next.config.js not blitz.config.js. Maybe because of that blitz can not wrap around next?

Has anybody an idea how I could fix it? Would really appreciate if somebody know a solution!

Note:

  • Yes, I specifically disabled the wrapping with next-pwa and it doesn't work. Even run terrafrom destroy, deleted .tf-next then build again with yarn tf-next and deployed again with terraform apply.
  • I am building on EC2 instance via Cloud9 on Amazon Linux:
    Bildschirmfoto 2021-11-17 um 14 56 32

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