reactjs / react-rails

Integrate React.js with Rails views and controllers, the asset pipeline, or webpacker.
Apache License 2.0
6.75k stars 759 forks source link

'javascript_pack_tag' location #733

Closed km-tr closed 7 years ago

km-tr commented 7 years ago

Help us help you! Please choose one:


Writing react_component before javascript_pack_tag when SSR is executed will result in an error.

Invariant Violation: Element type is invalid...

I made it behind javascript_pack_tag, the error no longer exists.

Is this a specification?

rmosolgo commented 7 years ago

Huh, that's a surprise for me!

The error your describing, does it happen in the browser or in the SSR process?

Can you share the full stack trace?

km-tr commented 7 years ago
Encountered error "#<ExecJS::ProgramError: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.>" when prerendering initalizer with {}
invariant (eval at <anonymous> ((execjs):113:1), <anonymous>:44:15)
instantiateReactComponent (eval at <anonymous> ((execjs):727:1), <anonymous>:74:23)
eval (eval at <anonymous> ((execjs):2098:1), <anonymous>:44:31)
ReactServerRenderingTransaction.TransactionImpl.perform (eval at <anonymous> ((execjs):500:1), <anonymous>:140:20)
renderToStringImpl (eval at <anonymous> ((execjs):2098:1), <anonymous>:43:24)
Object.renderToString (eval at <anonymous> ((execjs):2098:1), <anonymous>:73:10)
Object.ReactRailsUJS.serverRender (eval at <anonymous> ((execjs):1299:1), <anonymous>:70:42)
(execjs):6:45
(execjs):18:13
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs/ruby_racer_runtime.rb:36:in `rescue in block in eval'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs/ruby_racer_runtime.rb:33:in `block in eval'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs/ruby_racer_runtime.rb:75:in `block in lock'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs/ruby_racer_runtime.rb:73:in `Locker'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs/ruby_racer_runtime.rb:73:in `lock'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs/ruby_racer_runtime.rb:32:in `eval'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/server_rendering/exec_js_renderer.rb:39:in `render_from_parts'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/server_rendering/exec_js_renderer.rb:20:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/server_rendering/bundle_renderer.rb:40:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/server_rendering.rb:27:in `block in render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:64:in `block (2 levels) in with'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:63:in `handle_interrupt'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:63:in `block in with'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:60:in `handle_interrupt'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/connection_pool-2.2.0/lib/connection_pool.rb:60:in `with'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/server_rendering.rb:26:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/rails/component_mount.rb:67:in `prerender_component'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/rails/component_mount.rb:35:in `block in react_component'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/helpers/capture_helper.rb:202:in `with_output_buffer'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/helpers/capture_helper.rb:38:in `capture'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/helpers/tag_helper.rb:106:in `content_tag'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/rails/component_mount.rb:50:in `react_component'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/rails/view_helper.rb:21:in `react_component'
/Users/hoge/app/views/layouts/application.html.slim:11:in `_app_views_layouts_application_html_slim__951109991081902243_70133737008560'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/template.rb:145:in `block in render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164:in `block in instrument'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164:in `instrument'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/template.rb:333:in `instrument'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/template.rb:143:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiling_methods.rb:102:in `block in profile_method'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb:66:in `render_with_layout'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb:52:in `render_template'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb:14:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/renderer/renderer.rb:42:in `render_template'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/renderer/renderer.rb:23:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/rendering.rb:100:in `_render_template'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/streaming.rb:217:in `_render_template'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/rendering.rb:83:in `render_to_body'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/rendering.rb:32:in `render_to_body'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/renderers.rb:37:in `render_to_body'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/jpmobile-4.2.0/lib/jpmobile/hook_action_controller.rb:24:in `render_to_body_with_jpmobile'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/abstract_controller/rendering.rb:25:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/rendering.rb:16:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/hoge/.anyenv/envs/rbenv/versions/2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/core_ext/benchmark.rb:12:in `ms'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/instrumentation.rb:44:in `block in render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
/Users/hoge/vendor/bundle/ruby/2.3.0/bundler/gems/elasticsearch-rails-aa659145f886/elasticsearch-rails/lib/elasticsearch/rails/instrumentation/controller_runtime.rb:20:in `cleanup_view_runtime'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/instrumentation.rb:43:in `render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/meta-tags-2.1.0/lib/meta_tags/controller_helper.rb:26:in `render_with_meta_tags'
/Users/hoge/vendor/bundle/ruby/2.3.0/bundler/gems/view_object-15f11641b527/lib/view_object.rb:25:in `block in render_with_before_render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:117:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_render_callbacks'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/hoge/vendor/bundle/ruby/2.3.0/bundler/gems/view_object-15f11641b527/lib/view_object.rb:24:in `render_with_before_render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/abstract_controller/base.rb:198:in `process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/rendering.rb:10:in `process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:117:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/react-rails-2.2.0/lib/react/rails/controller_lifecycle.rb:31:in `use_react_component_helper'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:432:in `block in make_lambda'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:312:in `block in halting'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:497:in `block in around'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:505:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/abstract_controller/callbacks.rb:19:in `process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/rescue.rb:29:in `process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164:in `block in instrument'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164:in `instrument'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/abstract_controller/base.rb:137:in `process'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5/lib/action_view/rendering.rb:30:in `process'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiling_methods.rb:102:in `block in profile_method'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal.rb:196:in `dispatch'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_controller/metal.rb:237:in `block in action'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:45:in `serve'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/journey/router.rb:30:in `each'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/journey/router.rb:30:in `serve'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/routing/route_set.rb:817:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/bullet-5.1.0/lib/bullet/rack.rb:10:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/jquery-fileupload-rails-0.4.7/lib/jquery/fileupload/rails/middleware.rb:14:in `_call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/jquery-fileupload-rails-0.4.7/lib/jquery/fileupload/rails/middleware.rb:10:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/rack/browser_monitoring.rb:32:in `traced_call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/warden-1.2.4/lib/warden/manager.rb:35:in `block in call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/warden-1.2.4/lib/warden/manager.rb:34:in `catch'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/warden-1.2.4/lib/warden/manager.rb:34:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/etag.rb:24:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/conditionalget.rb:25:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/head.rb:13:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/jpmobile-4.2.0/lib/jpmobile/rack/mobile_carrier.rb:13:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/flash.rb:260:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/session/abstract/id.rb:225:in `context'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/session/abstract/id.rb:220:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/query_cache.rb:36:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:377:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/reloader.rb:73:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:84:in `protected_app_call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:79:in `better_errors_call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/better_errors-2.1.1/lib/better_errors/middleware.rb:57:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/web-console-3.0.0/lib/web_console/middleware.rb:27:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-dev-mark-0.7.5/lib/rack/dev-mark/middleware.rb:19:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:38:in `call_app'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:20:in `block in call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:26:in `tagged'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/tagged_logging.rb:68:in `tagged'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:20:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/quiet_assets-1.1.0/lib/quiet_assets.rb:27:in `call_with_quiet_assets'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/request_store-1.3.0/lib/request_store/middleware.rb:9:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/methodoverride.rb:22:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/runtime.rb:18:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/lock.rb:17:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/static.rb:116:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/sendfile.rb:113:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-cors-0.4.0/lib/rack/cors.rb:80:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiler.rb:278:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/engine.rb:518:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/application.rb:165:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.1.316/lib/new_relic/agent/instrumentation/middleware_tracing.rb:96:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/lock.rb:17:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/content_length.rb:15:in `call'
/Users/hoge/vendor/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/handler/webrick.rb:88:in `service'
/Users/hoge/.anyenv/envs/rbenv/versions/2.3.1/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
/Users/hoge/.anyenv/envs/rbenv/versions/2.3.1/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
/Users/hoge/.anyenv/envs/rbenv/versions/2.3.1/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'
km-tr commented 7 years ago

Excuse me. The cause of the error was elsewhere.

If I ceased to use import in the files incomponents, then the error ceased.

// import React from 'react'
↓
var React = require("react")

When trying with a another new application, even if I used import, it worked, It may be due to my .babelrc setting.

{
  "presets": [
    ["env", {
      "modules": false,
      "targets": {
        "browsers": "> 1%",
        "uglify": true
      },
      "useBuiltIns": true
    }],
    "react",
    "stage-1"
  ],

  "plugins": [
["module-alias",
      [
        .....
      ]
    ],
    "syntax-dynamic-import",
    "transform-decorators-legacy",
    "transform-class-properties"
  ]
}
rmosolgo commented 7 years ago

🤔 Wow, so by switching from import to require, this issue was resolved?

How strange! I wonder why!

SebAshton commented 7 years ago

@km-tr I had the same issue, and found the source of the error to be the auto-generated presets in the .babelrc

I went from when you have above to:

...
  "presets": [
    [
      "env",
      {
        "modules": false,
        "targets": {
          "browsers": "> 1%",
          "uglify": true
        },
        "useBuiltIns": true
      }
    ],
    "react",
    "es2015",
    "stage-0"
  ],
...

You'll need to also yarn add babel-preset-stage-0 babel-preset-es2015 --dev

I was then able to use imports etc as normal

km-tr commented 7 years ago

We have already added it to yarn. The cause of this time is in another part because it uses window.

BookOfGreg commented 7 years ago

If you don't mind, I'll mark this as closed unless there is something I can help you with. It sounds like this was solved at the time, thank you :)