Expo new blank (typescript) project had error while running on web browser

I was trying to start a new blank(typescript) project and make it run on web browser.
I got following error messages from console.

Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
    at Module.<anonymous> (bundle.js:63638)
    at Module.../../../react-dev-utils/node_modules/strip-ansi/node_modules/ansi-regex/index.js (bundle.js:63645)
    at __webpack_require__ (bundle.js:725)
    at fn (bundle.js:102)
    at Object.../../../react-dev-utils/node_modules/strip-ansi/index.js (bundle.js:63615)
    at __webpack_require__ (bundle.js:725)
    at fn (bundle.js:102)
    at Object.../../../react-dev-utils/webpackHotDevClient.js (bundle.js:63661)
    at __webpack_require__ (bundle.js:725)
    at fn (bundle.js:102)

and I checked the ansi-regex/index.js, it seems that you can’t just return an RegExp object to module.exports. Does anyone know how to solve this issue? Thanks.

"use strict";
/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../@babel/runtime/helpers/extends.js");
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);

module.exports = function (options) {
  options = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
    onlyFirst: false
  }, options);
  var pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|');
  return new RegExp(pattern, options.onlyFirst ? undefined : 'g');
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/harmony-module.js */ "../../../webpack/buildin/harmony-module.js")(module)))

Another vote to fix this issue. Exact same problem on a blank project. Makes it difficult to make sure your environment is correct.

Well, never mind. It seems this is fixed in the latest expo… npm i g expo-cli

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.