tricknotes / ember-cli-rails

Unify your EmberCLI and Rails Workflows
http://thoughtbot.github.io/ember-cli-rails/
MIT License
713 stars 205 forks source link

UnrecognizedURLError with ember-island #551

Closed adrian-fernandez closed 7 years ago

adrian-fernandez commented 7 years ago

I'm trying to use ember-cli-rails with ember-island to render components in rails views. Each time I try to include the js and css I get this error from ember:

jquery.js:3869 Uncaught UnrecognizedURLError {description: undefined, fileName: undefined, lineNumber: undefined, message: "/admin/invoices/new", name: "UnrecognizedURLError", …} (It doesn't matter the URL, it's the same with different urls).

If I run ember standalone (ember s) the app works fine, it only fails with rails.

Do you know what could be happening?

Which operating system and version is the project developed on? OSX El Capitan 10.11.6

Which version of ruby is the project developed on? ruby-2.3.1 [ x86_64 ]

Which version of npm is the project developed on? $ npm -v 4.0.5

Which version of ember-cli is the project developed on? $ ember -v ember-cli: 2.15.1 node: 7.4.0 os: darwin x64

What is the rails version? gem 'rails', '~> 5.0.0', '>= 5.0.0.1' (installed 5.0.6)

What is the ember-cli-rails version (from Gemfile)? 0.10.0

What is the ember-cli-rails-addon version (from package.json)? 0.8.0

Is your application server multi-threaded (such as puma and unicorn) or is it multi-process (such as thin and webrick)? puma, 1 proccess

What are the contents of config/initializers/ember.rb?

EmberCli.configure do |c|
  c.app :frontend
end

What are the contents of the Rails' view that renders the Ember application?

<%= include_ember_script_tags :frontend, prepend: '/' %>
<%= include_ember_stylesheet_tags :frontend, prepend: '/' %>

<%= ember_component(:div, 'electricity-invoice', { invoice_number: @item.invoice_number }) %>

def ember_component(tag, name, attrs = {})
  content_tag(tag, '', data: { component: name, attrs: attrs.to_json })
end

How are the EmberCLI-related routes defined? mount_ember_assets :frontend, to: '/'

How is the application deployed? Not deployed yet, only local