Skip to content

Firebase module not working in paperbits-demo publisher, works in designer #229

@feranto

Description

@feranto

Describe the bug
Using the paperbits-demo version 0.1.526 and trying to configure it to work with firebase, gives me the following error when trying to build the website.

To Reproduce
Steps to reproduce the behavior:

  1. Using the paperbits-demo version 0.1.526
  2. Adding the "@paperbits/firebase": "0.1.575" package in package.json
  3. Uncommenting the firebase import, and injection in startup.design.ts
  4. Uncommenting the firebase import, and injection in startup.publish.ts
  5. Adding the firebase configuration in config.design.json
  6. Adding the firebase configuration in config.publish.json
  7. Running the designer with npm start, works correctly stores data in real time database
  8. Running the publisher with npm run publish, gives the following error:
/paperbits-demo/dist/publisher/index.js:20397
module. Exports = firebase-admin;
                 ^

ReferenceError: firebase is not defined
    at Object.firebase-admin (/paperbits-demo/dist/publisher/index.js:20397:18)
    at __webpack_require__ (/paperbits-demo/dist/publisher/index.js:21114:42)
    at eval (webpack://paperbits-demo/./node_modules/@paperbits/firebase/services/firebaseService.admin.ts?:13:15)
    at Object../node_modules/@paperbits/firebase/services/firebaseService.admin.ts (/workspaces/help5gt-website/paperbits-demo/dist/publisher/index.js:17164:1)
    at __webpack_require__ (/paperbits-demo/dist/publisher/index.js:21114:42)
    at eval (webpack://paperbits-demo/./node_modules/@paperbits/firebase/firebase.admin.module.ts?:6:33)
    at Object../node_modules/@paperbits/firebase/firebase.admin.module.ts (/workspaces/help5gt-website/paperbits-demo/dist/publisher/index.js:17109:1)
    at __webpack_require__ (/paperbits-demo/dist/publisher/index.js:21114:42)
    at eval (webpack://paperbits-demo/./src/startup.publish.ts?:12:33)
    at Object../src/startup.publish.ts (/paperbits-demo/dist/publisher/index.js:19430:1)

Expected behavior
Publishers should be able to use firebase data and publish final website.

Desktop (please complete the following information):

  • OS: ubuntu 18.04
  • Browser Edge
  • Version 111.0.1661.51

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