1216 comments

I have an error when I put the direct url to a component that uses a plugin such as Jquery. (For example: http://localhost:8080/settings) I have the following error ReferenceError: $ is not defined
But when I load the homepage first (http://localhost:8080) and then go to /dashboard, I no longer have the error, could you tell me how to solve the problem.
It seems like plugins are loaded after the component is rendering

ReferenceError: $ is not defined
at Settings.componentWillMount (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\src\routes\Settings.js:23:9)
at D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactCompositeComponent.js:348:1
at measureLifeCyclePerf (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactCompositeComponent.js:75:1)
at ReactCompositeComponentWrapper.performInitialMount (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactCompositeComponent.js:347:1)
at ReactCompositeComponentWrapper.mountComponent (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactCompositeComponent.js:258:1)
at Object.mountComponent (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactReconciler.js:46:1)
at ReactDOMComponent.mountChildren (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactMultiChild.js:238:1)
at ReactDOMComponent._createContentMarkup (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactDOMComponent.js:653:1)
at ReactDOMComponent.mountComponent (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactDOMComponent.js:520:1)
at Object.mountComponent (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\~\react-dom\lib\ReactReconciler.js:46:1)
Hi savigool,

Do you have a separate view created for your settings route? All views share the same views/layout.pug template for loading plugins. If you have created a separate view, please make sure to extend the same views/layout.pug file.

If you haven't created a separate view then make sure you call your jQuery related code within componentDidMount of your React component.
Hi ,

Thank you for your reply. I call the JQuery code in componentWillMount, when I call it on componentDidMount it works, but I still have other errors.

On routes.js, for example i tried to use localStorage, I have the following errors:
ReferenceError: localStorage is not defined
at Object.loggedIn (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\src\routes.js:77:14)
at Object.requireAuth [as onEnter] (D:\Miakka_Corporation\Applications\VisionApAdminPanel\tmp\webpack:\src\routes.js:97:13)
at Array.transitionHook (D:\Miakka_Corporation\Applications\VisionApAdminPanel\node_modules\react-router\lib\TransitionUtils.js:49:10)
at D:\Miakka_Corporation\Applications\VisionApAdminPanel\node_modules\react-router\lib\TransitionUtils.js:120:17
at D:\Miakka_Corporation\Applications\VisionApAdminPanel\node_modules\react-router\lib\TransitionUtils.js:90:5
at next (D:\Miakka_Corporation\Applications\VisionApAdminPanel\node_modules\react-router\lib\AsyncUtils.js:39:12)
at loopAsync (D:\Miakka_Corporation\Applications\VisionApAdminPanel\node_modules\react-router\lib\AsyncUtils.js:56:3)
at runTransitionHooks (D:\Miakka_Corporation\Applications\VisionApAdminPanel\node_modules\react-router\lib\TransitionUtils.js:89:29)
at runEnterHooks (D:\Miakka_Corporation\Applications\VisionApAdminPanel\node_modules\react-router\lib\TransitionUtils.js:113:10)
at D:\Miakka_Corporation\Applications\VisionApAdminPanel\node_modules\react-router\lib\createTransitionManager.js:86:42

The same when I try to use other HTML5 components, like new Image(), i have Image is not defined.
When running the Relay example I get the error
"[dev:server] fetchWithRetries(): Failed to get response from server, tried 1 times.".

I've tried on Chrome and Firefox on OSX. Any ideas?

[dev:server] Node.js app is running at http://localhost:8080/
[2] [update:schema] Finished writing data/schema.graphql
[2] [update:schema] Finished writing data/schema.json
[2] [update:schema] [nodemon] clean exit - waiting for changes before restart
[2] [dev:server] fetchWithRetries(): Failed to get response from server, tried 1 times.

Write a comment

This is a great way to give the seller feedback and ask them questions about their item.

You must sign in to write a comment

Sign in to add this purchase to your account

$20
That's about 8 cups of coffee
4013Purchases

Licenses: Details »

Single application $20
Version:4.1.0
Type:
  • HTML Template
Bootstrap: Compatible with 3.3.x
Layouts:
  • Responsive
  • Fluid
  • Fixed-width
Browsers:
  • IE 9, 10, 11
  • Latest Chrome
  • Latest Firefox
  • Latest Opera
  • Latest Safari
Uses Less:No
Uses Sass:Yes
Categories:
Tags: admin, bootstrap, dashboard, graphql, laravel, meteor, rails, reactjs, redux, relay
Item#:WB09498FH
Released:2 years ago
Updated:4 months ago
Sold exclusively on WrapBootstrap
sketchpixy

sketchpixy

Signed up 2 years ago

Need a front-end theme?

About Bootstrap

Bootstrap is designed to help people of all skill levels – designer or developer, huge nerd or early beginner. Use it as a complete kit or use it to start something more complex.

Unlike other front-end toolkits, Bootstrap was designed first and foremost as a styleguide to document not only its features, but best practices and living, coded examples.

Built to support new HTML5 elements and syntax with progressively enhanced components.

Browser support

Bootstrap is tested and supported in major modern browsers like Chrome, Firefox, and Internet Explorer.

Tested and supported in Chrome, Safari, Firefox, Internet Explorer, and Opera.
  • Latest Chrome
  • Latest Safari
  • Latest Firefox
  • Internet Explorer 8/9/10/11
  • Latest Opera

Features & includes

Bootstrap provides an unparalleled array of features and reusable components that let you hit the ground running: