Solution: I was using a route /imports/api/tests/tests.js, tests being a reserved word for the lazy / eager loading architecture in Meteor, so it was a matter of changing all the words containing tests, including the path and filename.
Hello. I was a former meteor developer, back in the times where npm was still not there. I am trying to jump back in for a personal project and everything has changed so much I no longer know if it is worth it (do I have any knowledge that could be useful today?), and the tutorials are far from being as comprehensive as they were before. I am following the todos-master tutorial. For some reason, I am unable to import from the API folder when rendering a page with kadira flow router.
This is the js of the page:
// file in /imports/ui/pages/home.js
import { Template } from 'meteor/templating';
import { FlowRouter } from 'meteor/kadira:flow-router';
import {Tests} from '/imports/api/tests/tests.js';
import './home.html';
And then, my collection + schema
// file in /imports/api/tests/tests.js
import {Mongo} from 'meteor/mongo';
Just doing the import throws the following error when accesing the page:
Uncaught SyntaxError: Unexpected token import
There is no route for the path: /
Can someone help me out in this?
EDIT. Ok, I am reading this might have something to do with babel-runtime?
EDIT2. Adding more info
My package.json file goes like this (I will edit original post):
{
"name": "autoreche",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"babel-runtime": "^6.20.0",
"bcrypt": "^1.0.3",
"express": "^4.15.4",
"graphql": "^0.11.3",
"jquery": "^3.2.1",
"meteor-node-stubs": "~0.2.4",
"popper.js": "^1.12.5",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"tether": "^1.4.0",
"uniforms": "^1.20.3",
"uniforms-bootstrap4": "^1.20.3"
}
}
And, my meteor list and meteor npm list:
accounts-password 1.4.0 Password support for accounts
accounts-ui 1.1.9 Simple templates to add login widgets to an app
autopublish 1.0.7 (For prototyping only) Publish the entire database to all clients
blaze-html-templates 1.1.2 Compile HTML templates into reactive UI with Meteor Blaze
ecmascript 0.8.2 Compiler plugin that supports ES2015+ in all .js files
es5-shim 4.6.15 Shims and polyfills to improve ECMAScript 5 support
fourseven:scss 4.5.4 Style with attitude. Sass and SCSS support for Meteor.js.
kadira:blaze-layout 2.3.0 Layout Manager for Blaze (works well with FlowRouter)
kadira:flow-router 2.12.1 Carefully Designed Client Side Router for Meteor
meteor-base 1.1.0 Packages that every Meteor app needs
mobile-experience 1.0.4 Packages for a great mobile user experience
modules 0.10.0 CommonJS module system
mongo 1.2.2 Adaptor for using MongoDB and Minimongo over DDP
promise 0.9.0 ECMAScript 2015 Promise polyfill with Fiber support
reactive-var 1.0.11 Reactive variable
seba:minifiers-autoprefixer 1.0.1 Standard minifiers used with Meteor apps by default + css autoprefixer.
shell-server 0.2.4 Server-side component of the `meteor shell` command.
standard-minifier-js 2.1.1 Standard javascript minifiers used with Meteor apps by default.
tap:i18n 1.8.2 A comprehensive internationalization solution for Meteor
tracker 1.1.3 Dependency tracker to allow reactive callbacks
underscore 1.0.10 Collection of small helpers: _.map, _.each, ...
useraccounts:core 1.14.2 Meteor sign up and sign in templates core package.
zimme:active-route 2.3.2 Active route helpers
mad@mad-VirtualBox:~/autoreche$ sudo meteor npm list -depth 0
autoreche@ /home/mad/autoreche
βββ babel-runtime@6.26.0
βββ bcrypt@1.0.3
βββ bootstrap@4.0.0-beta extraneous
βββ express@4.15.4
βββ graphql@0.11.3
βββ jquery@3.2.1
βββ meteor-node-stubs@0.2.11
βββ popper.js@1.12.5
βββ react@15.6.1
βββ react-dom@15.6.1
βββ simpl-schema@0.3.2 extraneous
βββ tether@1.4.0
βββ uniforms@1.20.3
βββ uniforms-bootstrap4@1.20.3