Code Monkey home page Code Monkey logo

Comments (5)

iamvamshi avatar iamvamshi commented on August 15, 2024 1

@wewoor Thanks for your reply.
Above issue got resolved by upgrading the umi version to 3.5.0.

from dt-sql-parser.

iamvamshi avatar iamvamshi commented on August 15, 2024

Above issue is fixed by adding 'GENERATE_SOURCEMAP=false'.
"start": "GENERATE_SOURCEMAP=false react-scripts start",

but got same issue with my another project(Cloned from ant design pro). Here is the error.

<--- Last few GCs --->

[15221:0x104c00000] 102059 ms: Scavenge (reduce) 4083.9 (4100.4) -> 4083.4 (4101.7) MB, 4.2 / 0.0 ms (average mu = 0.313, current mu = 0.274) allocation failure
[15221:0x104c00000] 102075 ms: Scavenge (reduce) 4084.1 (4100.7) -> 4083.6 (4101.9) MB, 15.3 / 0.0 ms (average mu = 0.313, current mu = 0.274) allocation failure
[15221:0x104c00000] 102083 ms: Scavenge (reduce) 4084.4 (4103.9) -> 4083.8 (4103.9) MB, 7.2 / 0.0 ms (average mu = 0.313, current mu = 0.274) allocation failure

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x101319fc5 node::Abort() (.cold.1) [/usr/local/bin/node]
2: 0x1000b6169 node::Abort() [/usr/local/bin/node]
3: 0x1000b62df node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
4: 0x100200ba7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0x100200b43 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
6: 0x1003aec55 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
7: 0x1003b06fa v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
8: 0x1003abe25 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
9: 0x1003a9750 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
10: 0x1003b7e7a v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
11: 0x1003b7f01 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
12: 0x100385cd2 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
13: 0x100705d08 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
14: 0x100a8deb9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
15: 0x332d42bec463

Here is the package.json

{
"name": "ant-design-pro",
"version": "5.0.0-beta.2",
"private": true,
"description": "An out-of-box UI solution for enterprise applications",
"scripts": {
"analyze": "cross-env ANALYZE=1 umi build",
"build": "umi build",
"deploy": "npm run site && npm run gh-pages",
"dev": "npm run start:dev",
"gh-pages": "gh-pages -d dist",
"i18n-remove": "pro i18n-remove --locale=zh-CN --write",
"postinstall": "umi g tmp",
"lint": "umi g tmp && npm run lint:js && npm run lint:style && npm run lint:prettier",
"lint-staged": "lint-staged",
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ",
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style",
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
"lint:prettier": "prettier --check "src//*" --end-of-line auto",
"lint:style": "stylelint --fix "src/
/.less" --syntax less",
"openapi": "umi openapi",
"precommit": "lint-staged",
"prettier": "prettier -c --write "src/**/
"",
"start": "cross-env UMI_ENV=dev umi dev",
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev",
"start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev",
"start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev",
"start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev umi dev",
"start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev umi dev",
"pretest": "node ./tests/beforeTest",
"test": "umi test",
"test:all": "node ./tests/run-tests.js",
"test:component": "umi test ./src/components",
"tsc": "tsc --noEmit"
},
"lint-staged": {
"/*.less": "stylelint --syntax less",
"
/.{js,jsx,ts,tsx}": "npm run lint-staged:js",
"**/
.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write"
]
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 10"
],
"dependencies": {
"@ant-design/icons": "^4.5.0",
"@ant-design/pro-descriptions": "^1.6.8",
"@ant-design/pro-form": "^1.18.3",
"@ant-design/pro-layout": "^6.15.3",
"@ant-design/pro-table": "^2.30.8",
"@antv/data-set": "^0.11.8",
"@emotion/react": "^11.1.5",
"@emotion/styled": "^11.1.5",
"@projectstorm/react-diagrams": "^6.5.0",
"@types/lodash.debounce": "^4.0.6",
"@umijs/openapi": "^1.1.14",
"@umijs/plugin-openapi": "^1.2.0",
"@umijs/route-utils": "^1.0.36",
"antd": "^4.14.0",
"antd-form-builder": "^2.1.2",
"bizcharts": "^3.5.9",
"bizcharts-plugin-slider": "^2.1.1",
"classnames": "^2.2.6",
"closest": "0.0.1",
"dagre": "^0.8.5",
"dt-sql-parser": "^4.0.0-beta.2.2",
"file-saver": "^2.0.5",
"less": "^4.1.1",
"less-loader": "^8.1.0",
"lodash": "^4.17.21",
"lodash.debounce": "^4.0.8",
"moment": "^2.25.3",
"numeral": "^2.0.6",
"omit.js": "^2.0.2",
"pathfinding": "^0.4.18",
"paths-js": "^0.4.11",
"polished": "^4.1.1",
"react": "^17.0.2",
"react-dev-inspector": "^1.1.1",
"react-dom": "^17.0.0",
"react-fittext": "^1.0.0",
"react-helmet-async": "^1.0.4",
"react-modal-video": "^1.2.6",
"redux-persist": "^6.0.0",
"redux-persist-transform-filter": "0.0.20",
"resize-observer-polyfill": "^1.5.1",
"umi": "^3.4.0",
"umi-request": "^1.0.8"
},
"devDependencies": {
"@ant-design/pro-cli": "^2.0.2",
"@types/classnames": "^2.2.7",
"@types/express": "^4.17.0",
"@types/file-saver": "^2.0.2",
"@types/history": "^4.7.2",
"@types/jest": "^26.0.0",
"@types/lodash": "^4.14.144",
"@types/numeral": "^2.0.1",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-helmet": "^6.1.0",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"@umijs/fabric": "^2.5.2",
"@umijs/plugin-blocks": "^2.0.5",
"@umijs/plugin-esbuild": "^1.0.1",
"@umijs/preset-ant-design-pro": "^1.2.0",
"@umijs/preset-dumi": "^1.1.7",
"@umijs/preset-react": "^1.8.14",
"@umijs/preset-ui": "^2.2.9",
"@umijs/yorkie": "^2.0.3",
"carlo": "^0.9.46",
"cross-env": "^7.0.3",
"cross-port-killer": "^1.1.1",
"detect-installer": "^1.0.1",
"dotenv": "^10.0.0",
"enzyme": "^3.11.0",
"eslint": "^7.24.0",
"eslint-plugin-react": "^7.23.1",
"express": "^4.17.1",
"file-saver": "^2.0.2",
"gh-pages": "^3.0.0",
"jsdom-global": "^3.0.2",
"lint-staged": "^10.0.0",
"lodash-uuid": "0.0.3",
"mockjs": "^1.0.1-beta3",
"prettier": "^2.0.1",
"puppeteer-core": "^8.0.0",
"react-router-navigation-prompt": "^1.8.14",
"stylelint": "^13.0.0",
"typescript": "^4.2.2"
},
"engines": {
"node": ">=10.0.0"
}
}

from dt-sql-parser.

wewoor avatar wewoor commented on August 15, 2024

@iamvamshi If you only need one specific SQLParser, like GenericSQL, I recommend you import it using this way:

import GenericSQL from 'dt-sql-parser/dist/parser/generic';

The below way will build all parsers into one bundle file.

import { GenericSQL } from 'dt-sql-parser';

Also, you can refer to this repo monaco-sql-languages.

from dt-sql-parser.

iamvamshi avatar iamvamshi commented on August 15, 2024

@wewoor Could you please help me in configuring the webpack entry in antdesignpro cloned project. Here is the config file.

import { defineConfig } from 'umi';
import { join } from 'path';

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const path = require('path');
const APP_DIR = path.resolve(__dirname, './src');
const MONACO_DIR = path.resolve(__dirname, './node_modules/monaco-editor');

import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const { REACT_APP_ENV } = process.env;

export default defineConfig({
hash: true,
antd: {},
dva: {
hmr: true,
},
layout: {
// https://umijs.org/zh-CN/plugins/plugin-layout
locale: true,
siderWidth: 104,
...defaultSettings,
},
// https://umijs.org/zh-CN/plugins/plugin-locale
locale: {
default: 'en-US',
antd: false,
baseNavigator: false,
},
dynamicImport: {
loading: '@ant-design/pro-layout/es/PageLoading',
},
targets: {
ie: 11,
},
// umi routes: https://umijs.org/docs/routing
routes,
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
theme: {
'primary-color': defaultSettings.primaryColor,
'font-family': 'SPGrotesk, Helvetica, Arial, sans-serif',
'layout-body-background': '#F2F0F5',
},
// esbuild is father build tools
// https://umijs.org/plugins/plugin-esbuild
esbuild: {},
title: false,
ignoreMomentLocale: true,
proxy: proxy[REACT_APP_ENV || 'dev'],
manifest: {
basePath: '/',
},
openAPI: [
{
requestLibPath: "import { request } from 'umi'",
// 或者使用在线的版本
// schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
schemaPath: join(__dirname, 'oneapi.json'),
mock: false,
},
{
requestLibPath: "import { request } from 'umi'",
schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
projectName: 'swagger',
},
],
nodeModulesTransform: {
type: 'none',
},
// mfsu: {},
webpack5: {},
exportStatic: {},
chainWebpack(memo) {
memo.entry('sql.worker').add(path.resolve(__dirname, '../src/sql/sql.worker.ts')).end();
return memo;
},

});

As per the umi documentation this should work.

chainWebpack(memo) {
memo.entry('sql.worker').add(path.resolve(__dirname, '../src/sql/sql.worker.ts')).end();
return memo;
},

from dt-sql-parser.

wewoor avatar wewoor commented on August 15, 2024

@iamvamshi Sorry, I don't familiar with the ant design pro, but actually, I think you need to read this config document, as for how to config the language entry, you can refer to this repo monaco-sql-languages.

from dt-sql-parser.

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.