veliovgroup / flow-router

🚦 Carefully extended flow-router for Meteor
https://packosphere.com/ostrio/flow-router-extra
BSD 3-Clause "New" or "Revised" License
202 stars 29 forks source link

waitOn(): Uncaught (in promise) Error: Cannot find module #67

Closed valorloff closed 5 years ago

valorloff commented 5 years ago

Hi! Can you help with this bug?

Uncaught (in promise) Error: Cannot find module './edit.html'

FlowRouter.route('/admin/survey',
    {
        name: 'adminSurvey',
        title:'xxxxxx',
        waitOn() {
            return import('../../../ui/admin/surveys/index.js');
        },
        action() {

index.js:

import './list.html';
import './survey.html';
import './edit.html';
import './list.js';
import './edit.js';
import './survey.js';
import './events.js';

g1

dr-dimitru commented 5 years ago

Hello @valorloff ,

There is two options:

  1. Use absolute path starting with / (root), like: import('/imports/ui/admin/surveys/index.js);
  2. There is an error in edit.html (markup error), Blaze doesn't always point you to the issue when "dynamic" import(/*...*/) used. To figure out what exctly went wrong in HTML template, — import it statically

Let me know if that helps

valorloff commented 5 years ago

I moved import '/imports/ui/admin/surveys/edit.html'; to global client main.js, and same bug: Uncaught Error: Cannot find module '/imports/ui/admin/surveys/edit.html' Looks like this is not blaze/router problem, but Meteor caching maybe? What can you advise?

dr-dimitru commented 5 years ago

@valorloff We see this exception on daily basis, simply lint your HTML/Blaze markup

valorloff commented 5 years ago

Sorry for bothering. Over the past 3 years, I have not faced with such errors, my linter activated and does not indicate any errors in the templates. Please, what ESlint rule is specific for checking Blaze templates?

dr-dimitru commented 5 years ago

@valorloff I’m using default settings recommended by html-linter + sublime-linter

Some other thoughts:

valorloff commented 5 years ago
  • try to use empty HTML template, then add elements one-by-one to find the one causing exception

<textarea> without a closing tag </textarea> caused exception "Not found"!

it's just nonsense! no sense from ESlinter!

Thanks!

dr-dimitru commented 5 years ago

@valorloff Glad it's solved! I've been there, that's good you decided to ask for solution here :)

Feel free to close it in case if the issue is solved on your end.

valorloff commented 5 years ago

Any constructive discussion always useful!