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.

Prism not working on deployment

See original GitHub issue

Describe the bug Prism works on development, but not on deployment with netlify.

To Reproduce Steps to reproduce the behavior:

  1. Shadowed src/gatsby-plugin-theme-ui/components.ts:
import Prism from '@theme-ui/prism'
const components = {
  pre: props => props.children,
  code: Prism,
}
export default components

Also defined the style in src/gatsby-plugin-theme-ui/index.ts:

import nightOwl from '@theme-ui/prism/presets/night-owl.json';

export default {
    pre: {
      ...nightOwl,
      fontFamily: `"Operator Mono", monospace`,
      fontSize: '0.9rem',
      tabSize: 4,
      hyphens: `none`,
      overflow: `auto`,
      borderRadius: 6,
      p: 3,
      my: 4
    },
}
  1. Works on localhost:8000, but not deployment. To be clear, the font family does change, but not the background colour.

Screenshots Screenshot below shows what I mean. Font family is correct, but background colour hasnโ€™t changed: Screenshot 2020-08-28 at 7 12 24 AM

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
drjosephliucommented, Sep 3, 2020

Ok I finally got it working and prism is working as normal. Hereโ€™s what I did:

  • Clean yarn.lock and node_modules and reinstall dependencies again.
  • yarn add @emotion/core@^10.0.0

And fixed unmet/incorrect peer dependencies:

  • yarn add @babel/core@^7.11.5
  • yarn add typescript@^4.0.2
0reactions
drjosephliucommented, Sep 3, 2020

@mrmartineau So i deleted yarn.lock and node_modules and reinstalled the dependencies again. However, deployment via netlify returned a build failure:

7:41:23 AM: failed Building production JavaScript and CSS bundles - 5.488s
7:41:23 AM: error Generating JavaScript bundles failed
7:41:23 AM: [BABEL] /opt/build/repo/.cache/polyfill-entry.js: Cannot read property 'chrome' of undefined (While processing: "/opt/build/repo/node_modules/@babel/preset-env/lib/index.js")
7:41:23 AM: error Generating JavaScript bundles failed
7:41:23 AM: [BABEL] /opt/build/repo/.cache/production-app.js: Cannot read property 'chrome' of undefined (While processing: "/opt/build/repo/node_modules/@babel/preset-env/lib/index.js")
7:41:23 AM: not finished Generating image thumbnails - 13.375s
7:41:23 AM: (sharp:1475): GLib-CRITICAL **: 11:41:23.192: g_hash_table_lookup: assertion 'hash_table != NULL' failed
7:41:23 AM: โ€‹
7:41:23 AM: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
7:41:23 AM: โ”‚   "build.command" failed    โ”‚
7:41:23 AM: โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
7:41:23 AM: โ€‹
7:41:23 AM:   Error message
7:41:23 AM:   Command failed with exit code 1: gatsby build
7:41:23 AM: โ€‹
7:41:23 AM:   Error location
7:41:23 AM:   In Build command from Netlify app:
7:41:23 AM:   gatsby build
7:41:23 AM: โ€‹
7:41:23 AM:   Resolved config
7:41:23 AM:   build:
7:41:23 AM:     command: gatsby build
7:41:23 AM:     commandOrigin: ui
7:41:23 AM:     publish: /opt/build/repo/public
Read more comments on GitHub >

github_iconTop Results From Across the Web

Prism Central (PC) 1-click deployment fails to complete
Prism Central (PC) deployment via the Prism 1-click method fails to complete and overall status shows "Failed". Get error as below in Prism...
Read more >
Deploying Applications Using the Prism Library for WPF
To successfully move a Prism application into production, you need to plan for deployment as part of the design process of your application....
Read more >
Standalone deployment - SS&C Blue Prism | Docs
An overview of the steps typically required to complete a standalone deployment are provided below. If problems are experienced whilst installing,ย ...
Read more >
Prism Deploy - New Boundary Technologies
Prism Deploy ยฎ deploys software and administrative tasks to multiple computers ... Post-rollout visits to fix problems are a thing of the past....
Read more >
How to deploy a Prisma app to Vercel
Learn how to deploy to Vercel a Next.js app that uses a serverless REST API in ... This can be a problem if...
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