Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importmap pin material-components-web --download did not download all dependencies #157

Closed
pedz opened this issue Nov 12, 2022 · 1 comment

Comments

@pedz
Copy link

pedz commented Nov 12, 2022

General disclaimer: I don't pretend to know what I'm doing but I think this isn't pilot error.

I had my page working. I then reset my config/importmap.rb back to its original state and did importmap pin material-components-web --download. Then I restarted the server and hit reload on the browser. I got these errors in the development log as well as similar errors in the browser's console.

ActionController::RoutingError (No route matches [GET] "/assets/_/0de2e5df.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/11149786.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/22618647.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/3b218f63.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/5e4511d6.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/68e6cd11.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/6cbdd747.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/78320754.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/8d64af94.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/9346910f.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/94ad6608.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/961b8fcc.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/e38018b4.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/ed910571.js"):
ActionController::RoutingError (No route matches [GET] "/assets/_/f69e15dd.js"):
ActionController::RoutingError (No route matches [GET] "/assets/character-counter/index.js"):
ActionController::RoutingError (No route matches [GET] "/assets/component.js"):
ActionController::RoutingError (No route matches [GET] "/assets/constants.js"):
ActionController::RoutingError (No route matches [GET] "/assets/foundation.js"):
ActionController::RoutingError (No route matches [GET] "/assets/helper-text/index.js"):
ActionController::RoutingError (No route matches [GET] "/assets/icon/constants.js"):
ActionController::RoutingError (No route matches [GET] "/assets/icon/foundation.js"):
ActionController::RoutingError (No route matches [GET] "/assets/icon/index.js"):

Aside from not working, I couldn't figure out a simple work around.

Again... not knowing what I'm doing or talking about, the /assets/component.js type paths trouble me. This particular set of errors comes from mdc-textfield and looking at the file, the paths are relative such as ./component.js so I'm assuming that is suppose to be relative to the mdc-textfield subdirectory since many components have a component.ts file in the git repository. But in vendor/javascripts, there are no subdirectories for each of the components. Rather, everything is just flat files so simply creating a local component.js file might get mdc-textfield working but will break on all the other MDC components.

I'm using Rails 7.0.4.

For now, I'll just go back to pulling it down from JSPM but I thought I would mention it. Eventually I want to be able to have all of the assets local so the app I'm working on can operate off line if necessary.

@dhh
Copy link
Member

dhh commented Apr 23, 2023

Import map requires a pointer to a fully compiled version of the remote JS. Seems like material-components-web doesn't supply that. Would be nice if we'd raise an error on that, if it's something that can be detected. But otherwise there's not much to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants