Home > Software design >  mybatis mapper on node express xml regular expression error
mybatis mapper on node express xml regular expression error

Time:01-03

when I open the web page via node express mybatis-mapper, it works on dev environment on my PC(windows vscode). But it not works on linux(ubuntu) server with below error message.

It seems like xml encoding error, but I can't find the way to solve. (ex. special character & -> /amp )

please help me find the way..

SyntaxError: Invalid regular expression: /^([\p{Alphabetic}\p{Mark}\p{Decimal_Number}\p{Connector_Punctuation}\p{Join_Control}] )/: Invalid escape
    at new RegExp (<anonymous>)
    at Object.createWordRegex (/home/minieyes85/node_modules/sql-formatter/lib/core/regexFactory.js:38:10)
    at new Tokenizer (/home/minieyes85/node_modules/sql-formatter/lib/core/Tokenizer.js:74:36)
    at StandardSqlFormatter.tokenizer (/home/minieyes85/node_modules/sql-formatter/lib/languages/StandardSqlFormatter.js:57:14)
    at StandardSqlFormatter.format (/home/minieyes85/node_modules/sql-formatter/lib/core/Formatter.js:87:26)
    at Object.format (/home/minieyes85/node_modules/sql-formatter/lib/sqlFormatter.js:74:29)
    at MybatisMapper.getStatement (/home/minieyes85/node_modules/mybatis-mapper/index.js:109:32)
    at router.get (/home/minieyes85/routes/main.js:51:28)
    at Layer.handle [as handle_request] (/home/minieyes85/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/minieyes85/node_modules/express/lib/router/route.js:144:13)

checked preference setting of vscode text-editor encoding -> utf-8

open the web page without error

CodePudding user response:

yes because syntax error at new RegExp () at Object.createWordRegex (/home/minieyes85/node_modules/sql-formatter/lib/core/regexFactory.js:38:10) at new Tokenizer (/home/minieyes85/node_modules/sql-formatter/lib/core/Tokenizer.js:74:36) at StandardSqlFormatter.tokenizer (/home/minieyes85/node_modules/sql-formatter/lib/languages/StandardSqlFormatter.js:57:14) at StandardSqlFormatter.format (/home/minieyes85/node_modules/sql-formatter/lib/core/Formatter.js:87:26) at Object.format (/home/minieyes85/node_modules/sql-formatter/lib/sqlFormatter.js:74:29) at MybatisMapper.getStatement

CodePudding user response:

yes because syntax error at new RegExp () at Object.createWordRegex (/home/minieyes85/node_modules/sql-formatter/lib/core/regexFactory.js:38:10) at new Tokenizer (/home/minieyes85/node_modules/sql-formatter/lib/core/Tokenizer.js:74:36) at StandardSqlFormatter.tokenizer (/home/minieyes85/node_modules/sql-formatter/lib/languages/StandardSqlFormatter.js:57:14) at StandardSqlFormatter.format (/home/minieyes85/node_modules/sql-formatter/lib/core/Formatter.js:87:26) at Object.format (/home/minieyes85/node_modules/sql-formatter/lib/sqlFormatter.js:74:29) at MybatisMapper.getStatement

  • Related