Giter VIP home page Giter VIP logo

Comments (9)

dmuley17 avatar dmuley17 commented on June 15, 2024

Can someone please help on this ?

from elements.

xeniakra10 avatar xeniakra10 commented on June 15, 2024

anyone? How to deal with this?

from elements.

chohmann avatar chohmann commented on June 15, 2024

@dmuley17 what version of elements are you using? We believe we fixed an issue similar to this and it was released in version 7.13.9 of elements.

If you are using this version or later and still experiencing this issue, please give us the following information:

  1. Are you using web components, angular, react, etc. flavor of elements?
  2. Can you provide a minimal reproducible example app that shows the error?

from elements.

dmuley17 avatar dmuley17 commented on June 15, 2024

Hello, we are just following the documents and trying to create new react project. its failing with that too.

https://docs.stoplight.io/docs/elements/11b969f962273-elements-dev-portal-in-react

image

from elements.

github-actions avatar github-actions commented on June 15, 2024

This ticket has been labeled jira. A tracking ticket in Stoplight's Jira (STOP-93) has been created.

from elements.

daniel-white avatar daniel-white commented on June 15, 2024

@dmuley17 for docuasaurus, i found this plugin https://www.npmjs.com/package/docusaurus-node-polyfills that seems to remedy the problem. we'll update our docs and keep working on create-react-app.

from elements.

dnyaneshwar-m avatar dnyaneshwar-m commented on June 15, 2024

unfortunatly that is not helping, i am still having the same issue. Let us know if any specific steps to follow.
I followed below steps
1] Ran yarn add @stoplight/elements-dev-portal under docusasuras app
2] Added plugins: ['docusaurus-node-polyfills'], in docusaurus.config.js
3] Ran npm install docusaurus-node-polyfills --save-dev
4] Made the changes as per doc

import React from 'react';
import Layout from '@theme/Layout';
import { StoplightProject } from '@stoplight/elements-dev-portal';
import '@stoplight/elements-dev-portal/styles.min.css';

export default function Hello() {
  return (
    <Layout title="Hello" description="Hello React Page">
      <div
        style={{
          display: 'flex',
          justifyContent: 'center',
          alignItems: 'center',
          height: '50vh',
          fontSize: '20px',
        }}>
        <p>
        <StoplightProject projectId="*" />
        </p>
      </div>
    </Layout>
  );
}

and access the page http://localhost:3000/helloReact

and it still shows the error of

Uncaught (in promise) ReferenceError: process is not defined
    at eval (core.esm.js:5936:58)
    at ./node_modules/@stoplight/mosaic/core.esm.js (vendors-node_modules_stoplight_elements-dev-portal_styles_min_css-node_modules_stoplight_elem-1ee554.js:1582:1)
    at __webpack_require__ (runtime~main.js:36:33)
    at fn (runtime~main.js:355:21)
    at eval (index.mjs:23:75)
    at ./node_modules/@stoplight/elements-dev-portal/index.mjs (vendors-node_modules_stoplight_elements-dev-portal_styles_min_css-node_modules_stoplight_elem-1ee554.js:7057:1)
    at __webpack_require__ (runtime~main.js:36:33)
    at fn (runtime~main.js:355:21)
    at eval (helloReact.js:7:88)
    at ./src/pages/helloReact.js

from elements.

dmuley17 avatar dmuley17 commented on June 15, 2024

Hello is this confirmed that issue is still exist @daniel-white

from elements.

mallachari avatar mallachari commented on June 15, 2024

@dmuley17 @dnyaneshwar-m similarly to CRA case you may try using node-polyfill-webpack-plugin. It should handle all missing polyfills that were supported within webpack earlier.

To do that in docusaurus you'll need to add a custom plugin:

  • instal node-polyfill-webpack-plugin: yarn add node-polyfill-webpack-plugin --dev
  • create a new file for the plugin such as. ./plugins/webpackPolyfillPlugin.js:
// ./plugins/webpackPolyfillPlugin.js
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

module.exports = function (context, options) {
  return {
    name: 'webpack-polyfill-plugin',
    configureWebpack(config, isServer, utils) {
      return {
        plugins: [new NodePolyfillPlugin()],
      };
    },
  };
};
  • use the custom plugin in docusaurus configuration:
// docusaurus.config.js
module.exports = {
  ...
  plugins: [
    ...
    require.resolve('./plugins/webpackPolyfillPlugin'),
  ],
};

When running it with StoplightProject you may need to set different router property as the default history (BrowserRouter) is not handled by SSR. We may add support for that later on.

from elements.

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.