Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in JavaScript for the bundle. #1973

Open
voodooattack opened this Issue Oct 6, 2018 · 14 comments

Comments

Projects
None yet
6 participants
@voodooattack
Copy link

commented Oct 6, 2018

Do you want to request a feature or report a bug?

Report a bug.

Intended outcome:

Run the *-on-build image.

Actual outcome:

I get this error in my console when I try to load the iframe:

Uncaught (in promise) TypeError: Cannot read property 'fields' of undefined
    at o (bundle.1bea1667b3d6f0d2d758.js:25)
    at bundle.1bea1667b3d6f0d2d758.js:25
    at u (bundle.1bea1667b3d6f0d2d758.js:25)
    at bundle.1bea1667b3d6f0d2d758.js:25
    at Array.reduce (<anonymous>)
    at i (bundle.1bea1667b3d6f0d2d758.js:25)
    at u (bundle.1bea1667b3d6f0d2d758.js:25)
    at bundle.1bea1667b3d6f0d2d758.js:25
    at Array.reduce (<anonymous>)
    at i (bundle.1bea1667b3d6f0d2d758.js:25)

How to reproduce the issue:

This is my current setup:

docker-compose.yml:

version: '2'
services:
  talk:
    build:
       context: ./build
#    image: coralproject/talk:latest
    dns:
      - 1.1.1.1
      - 1.0.0.1
      - 8.8.8.8
    restart: always
    ports:
      - "3000:3000"
    depends_on:
      - mongo
      - redis
    environment:
      - TALK_MONGO_URL=mongodb://mongo/talk
      - TALK_REDIS_URL=redis://redis
      - TALK_INSTALL_LOCK=TRUE
      - TALK_ROOT_URL=https://talk.themagineer.com/
      - TALK_PORT=3000
      - TALK_JWT_SECRET=******
      - TALK_GOOGLE_CLIENT_ID=****
      - TALK_GOOGLE_CLIENT_SECRET=****
  mongo:
    image: mongo:latest
    restart: always
    volumes:
      - mongo:/data/db
  redis:
    image: redis:latest
    restart: always
    volumes:
      - redis:/data
volumes:
  mongo:
    external: false
  redis:
    external: false

build/Dockerfile:

FROM coralproject/talk:latest-onbuild

ONBUILD RUN cli plugins reconcile && yarn && yarn build && yarn cache clean

build/plugins.json:

{
  "server":[
    "talk-plugin-featured-comments",
    "talk-plugin-local-auth",
    "talk-plugin-profile-data",
    "talk-plugin-respect",
    "talk-plugin-google-auth"
  ],
  "client":[
    "talk-plugin-auth",
    "talk-plugin-author-menu",
    "talk-plugin-featured-comments",
    "talk-plugin-flag-details",
    "talk-plugin-ignore-user",
    "talk-plugin-local-auth",
    "talk-plugin-member-since",
    "talk-plugin-moderation-actions",
    "talk-plugin-permalink",
    "talk-plugin-profile-data",
    "talk-plugin-respect",
    "talk-plugin-like",
    "talk-plugin-sort-most-replied",
    "talk-plugin-sort-most-respected",
    "talk-plugin-sort-newest",
    "talk-plugin-sort-oldest",
    "talk-plugin-viewing-options",
    "talk-plugin-google-auth"
  ]
}

As you can see, I'm using the default plugins and only adding 'google-auth'. The original image works flawlessly, but when I try to add the plugin that error happens in the browser.

Version and environment

Talk version: 4.6.4-onbuild
System: Ubuntu 18.04.1 LTS
Browser: Chrome Version 69.0.3497.100 (Official Build) (64-bit)

@striedinger

This comment has been minimized.

Copy link

commented Oct 6, 2018

As far as I know from my little experience working with Talk so far, you don't need this line:

ONBUILD RUN cli plugins reconcile && yarn && yarn build && yarn cache clean

If your only intention is enabling/disabling plugins it will definitely work without it.

@voodooattack

This comment has been minimized.

Copy link
Author

commented Oct 7, 2018

As far as I know from my little experience working with Talk so far, you don't need this line:

ONBUILD RUN cli plugins reconcile && yarn && yarn build && yarn cache clean

If your only intention is enabling/disabling plugins it will definitely work without it.

Yeah, I realise that now. The issue still happens even without it, though.

@wyattjoh

This comment has been minimized.

Copy link
Member

commented Oct 11, 2018

Have you installed Talk via the /admin/install route @voodooattack?

@wyattjoh wyattjoh self-assigned this Oct 11, 2018

@voodooattack

This comment has been minimized.

Copy link
Author

commented Oct 11, 2018

@wyattjoh

This comment has been minimized.

Copy link
Member

commented Oct 11, 2018

Give it another try after pulling the latest current onbuild image.

@voodooattack

This comment has been minimized.

Copy link
Author

commented Oct 22, 2018

@wyattjoh It took me two tries, but I got it to build, and the same issue still happens.

Uncaught (in promise) TypeError: Cannot read property 'fields' of undefined

@wyattjoh

This comment has been minimized.

Copy link
Member

commented Oct 22, 2018

Can you send a HAR archive with content over to wyatt at mozillafoundation.org? We can't reproduce the error on our side.

@voodooattack

This comment has been minimized.

Copy link
Author

commented Oct 22, 2018

Sent! 👍

@batuhan

This comment has been minimized.

Copy link

commented Nov 23, 2018

I'm hitting the same bug.

Would you mind sharing if you happened to find a solution, @voodooattack?

@voodooattack

This comment has been minimized.

Copy link
Author

commented Nov 23, 2018

I'm hitting the same bug.

Would you mind sharing if you happened to find a solution, @voodooattack?

No solution is forthcoming still, unfortunately.

I'm still using the default image.

@takeit

This comment has been minimized.

Copy link

commented Dec 10, 2018

I'm getting the same error: Uncaught (in promise) TypeError: Cannot read property 'fields' of undefined. Coral Talk 4.6.0. Any idea how to workaround this?

@wyattjoh

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

My best guess is that there is some document in your database that's causing the bug, because from a fresh install, with the exact plugins.json and docker-compose.yml file, our team is unable to reproduce the error you're experiencing.

Can you test with a fresh install if the error is occurring?

@takeit

This comment has been minimized.

Copy link

commented Dec 11, 2018

Sure @wyattjoh, we will try that. We imported users and assets (without comments) from 3rd party system using https://github.com/coralproject/talk-importer. In the Talk admin panel, everything loads properly. Is there a way to find out which documents make problems?

We will try with fresh install and step by step check when it fails to load the embed. Thanks.

@takeit

This comment has been minimized.

Copy link

commented Dec 14, 2018

FYI: We've managed to solve the issue by changing the node version from v8.12.0 to v8.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.