I’m using vue-router with dynamic import exactly as you have it in the first case and it’s working perfectly on Digital Ocean.
The reason it’s working for you in the 2nd case (where you manually import the component at the top) is because then it’s not being imported dynamically, instead it’s part of the initial app bundle. Open an incognito tab in chrome and watch the devtools network tab and you will not see any requests to __meteor__/dynamic-import/fetch on this route. That will tell you that the component is already part of the app bundle.
The problem is with your dynamic import, see the error http://68.183.176.122/__meteor__/dynamic-import/fetch net::ERR_CONNECTION_REFUSED.
The dynamic import module cannot access your server to fetch the file.
How are you deploying to Digital Ocean? mup? Do you have a domain name? The dynamic import should be using your domain name (if you have one) rather than the IP
What happens if you enter “http://68.183.176.122/__meteor__/dynamic-import/fetch” in a browser while the server is running? You should get the response “method GET not allowed”.
module.exports = {
servers: {
one: {
// TODO: set host address, username, and authentication method
host: '1.2.3.4',
username: 'root',
pem: '~/.ssh/id_rsa',
// password: 'server-password'
// or neither for authenticate from ssh-agent
},
},
app: {
// TODO: change app name and path
name: 'meteor-element',
path: '../',
volumes: {
'/data/file_uploads': '/data/file_uploads',
},
servers: {
one: {},
},
buildOptions: {
serverOnly: true,
},
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: 'http://1.2.3.4',
MONGO_URL: 'mongodb://mongodb/meteor-element',
MONGO_OPLOG_URL: 'mongodb://mongodb/local',
PORT: 9999,
},
docker: {
// change to 'abernix/meteord:base' if your app is using Meteor 1.4 - 1.5
image: 'abernix/meteord:node-8.4.0-base',
},
// The maximum number of seconds it will wait
// for your app to successfully start (optional, default is 60)
deployCheckWaitTime: 120,
// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true,
},
mongo: {
version: '4.0.5',
servers: {
one: {},
},
},
// (Optional)
// Use the proxy to setup ssl or to route requests to the correct
// app when there are several apps
// proxy: {
// domains: 'mywebsite.com,www.mywebsite.com',
// ssl: {
// // Enable Let's Encrypt
// letsEncryptEmail: 'email@domain.com'
// }
// }
}
env: {
// TODO: Change to your app's url
// If you are using ssl, it needs to start with https://
ROOT_URL: 'http://1.2.3.4:9999',
MONGO_URL: 'mongodb://mongodb/meteor-element',
MONGO_OPLOG_URL: 'mongodb://mongodb/local',
PORT: 9999,
},