Skip to content

Attempted import error: 'ViewPropTypes' is not exported from 'react-native-web/dist/index'. #313

@Natetronn

Description

@Natetronn

I tried to access the app using Expo Web and got one error in terminal and one in the browser. It seemed to work fine in Android emulator, however.

Terminal error:

Compiled with warnings.
/home/usnerame/Code/htmlviewExpo/node_modules/react-native-htmlview/HTMLView.js
Attempted import error: 'ViewPropTypes' is not exported from 'react-native-web/dist/index'.

Not sure if it's related but, I saw this issue as well, which also mentions HTMLView.js line 149: #311

And this browser error, which would seem to make sense if ViewPropTypes isn't exported any more by react-native-web. Possibly more on that here: necolas/react-native-web#1537

And a possible solution was suggested here: necolas/react-native-web#1537 (comment) (not sure that's the best way or not but, trying to help troubleshoot or at least research. Hope that helps.)

Initial browser error with no visable app/site:

TypeError: can't access property "style", react_native_web_dist_index__WEBPACK_IMPORTED_MODULE_14__.ViewPropTypes is undefined
../../../../../../../../../../../Code/htmlviewExpo/node_modules/react-native-htmlview/HTMLView.js
node_modules/react-native-htmlview/HTMLView.js:149

  146 | renderNode: PropTypes.func,
  147 | RootComponent: PropTypes.func,
  148 | rootComponentProps: PropTypes.object,
> 149 | style: ViewPropTypes.style,
      | ^  150 | stylesheet: PropTypes.object,
  151 | TextComponent: PropTypes.func,
  152 | textComponentProps: PropTypes.object,

__webpack_require__
/home/username/Code/htmlviewExpo/webpack/bootstrap:789

  786 | };
  787 | 
  788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  790 | 
  791 | // Flag the module as loaded
  792 | module.l = true;

fn
/home/username/Code/htmlviewExpo/webpack/bootstrap:100

   97 | 		);
   98 | 		hotCurrentParents = [];
   99 | 	}
> 100 | 	return __webpack_require__(request);
      | ^  101 | };
  102 | var ObjectFactory = function ObjectFactory(name) {
  103 | 	return {

../../../../../../../../../../../Code/htmlviewExpo/node_modules/react-native-htmlview/index.js
node_modules/react-native-htmlview/index.js:1
__webpack_require__
/home/username/Code/htmlviewExpo/webpack/bootstrap:789

  786 | };
  787 | 
  788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  790 | 
  791 | // Flag the module as loaded
  792 | module.l = true;

fn
/home/username/Code/htmlviewExpo/webpack/bootstrap:100

   97 | 		);
   98 | 		hotCurrentParents = [];
   99 | 	}
> 100 | 	return __webpack_require__(request);
      | ^  101 | };
  102 | var ObjectFactory = function ObjectFactory(name) {
  103 | 	return {

../../../../../../../../../../../Code/htmlviewExpo/App.js
http://localhost:19006/static/js/bundle.js:887:98
__webpack_require__
/home/username/Code/htmlviewExpo/webpack/bootstrap:789

  786 | };
  787 | 
  788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  790 | 
  791 | // Flag the module as loaded
  792 | module.l = true;

fn
/home/username/Code/htmlviewExpo/webpack/bootstrap:100

   97 | 		);
   98 | 		hotCurrentParents = [];
   99 | 	}
> 100 | 	return __webpack_require__(request);
      | ^  101 | };
  102 | var ObjectFactory = function ObjectFactory(name) {
  103 | 	return {

../../../../../../../../../../../Code/htmlviewExpo/node_modules/expo/AppEntry.js
node_modules/expo/AppEntry.js:1
__webpack_require__
/home/username/Code/htmlviewExpo/webpack/bootstrap:789

  786 | };
  787 | 
  788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  790 | 
  791 | // Flag the module as loaded
  792 | module.l = true;

fn
/home/username/Code/htmlviewExpo/webpack/bootstrap:100

   97 | 		);
   98 | 		hotCurrentParents = [];
   99 | 	}
> 100 | 	return __webpack_require__(request);
      | ^  101 | };
  102 | var ObjectFactory = function ObjectFactory(name) {
  103 | 	return {

1
http://localhost:19006/static/js/bundle.js:65801:18
__webpack_require__
/home/username/Code/htmlviewExpo/webpack/bootstrap:789

  786 | };
  787 | 
  788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  790 | 
  791 | // Flag the module as loaded
  792 | module.l = true;

(anonymous function)
/home/username/Code/htmlviewExpo/webpack/bootstrap:856

  853 | 
  854 | 
  855 | // Load entry module and return exports
> 856 | return hotCreateRequire(1)(__webpack_require__.s = 1);
      | ^  857 | 

(anonymous function)
http://localhost:19006/static/js/bundle.js:860:10
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.  Click the 'X' or hit ESC to dismiss this message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions