Closed GautierT closed 7 years ago
Hi @GautierT, you're right! This is something we have to improve, but I can't give you any ETA.
I disable the code verif made by the module and it's working. And on my server Babel run before so it's okay for now
Le mer. 5 juil. 2017 17:29, Arnaud Besnier notifications@github.com a Γ©crit :
Hi @GautierT https://github.com/gautiert, you're right! This is something we have to improve, but I can't give you any ETA.
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ForestAdmin/forest-express-mongoose/issues/70#issuecomment-313138262, or mute the thread https://github.com/notifications/unsubscribe-auth/AFzrtRn7BT_rEA6wy3C5Km3r7OZAFwADks5sK6vGgaJpZM4OOYz1 .
@GautierT sorry for the misunderstanding on my side :( It will be fixed this week for sure.
@GautierT,
The fix is now available on the latest liana version (1.4.3).
π²π²π²
I still have the error after updating :
[forest] π³π³π³ Forest customization failed due to a syntax error: Unexpected token in /Users/gautier/Documents/Projets/____________/src/functions/forest/index.js:2
[forest] π³π³π³ An error occured while computing the Forest apimap. Your application apimap cannot be sent to Forest. Your Admin UI might not reflect your application models.
Error
at /Users/gautier/Documents/Projets/____________/node_modules/forest-express/index.js:160:23
at tryCatcher (/Users/gautier/Documents/Projets/____________/node_modules/forest-express/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/gautier/Documents/Projets/____________/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:503:31)
at Promise._settlePromise (/Users/gautier/Documents/Projets/____________/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:560:18)
at Promise._settlePromiseCtx (/Users/gautier/Documents/Projets/____________/node_modules/forest-express/node_modules/bluebird/js/release/promise.js:597:10)
at Async._drainQueue (/Users/gautier/Documents/Projets/____________/node_modules/forest-express/node_modules/bluebird/js/release/async.js:131:12)
at Async._drainQueues (/Users/gautier/Documents/Projets/____________/node_modules/forest-express/node_modules/bluebird/js/release/async.js:136:10)
at Immediate.Async.drainQueues (/Users/gautier/Documents/Projets/____________/node_modules/forest-express/node_modules/bluebird/js/release/async.js:16:14)
at runCallback (timers.js:637:20)
at tryOnImmediate (timers.js:610:5)
at processImmediate [as _immediateCallback] (timers.js:582:5)
First 2 line of src/forest/index.js
'use strict'
import Liana from 'forest-express-mongoose'
What happens if you set a semi-colon at the end of the import line?
I still have the same error.
I had to remove this block
return codeSyntaxInspector
.extractCodeSyntaxErrorInDirectoryFile(directorySmartImplementation)
.then(function (hasError) {
if (hasError) {
throw new Error();
} else {
// NOTICE: Do not display an error log if the forest/ directory
// does not exist.
return requireAllModels(Implementation,
directorySmartImplementation, false);
}
});
On forest-express/index.js line 160 and replace it by
return requireAllModels(Implementation,
directorySmartImplementation, false);
@GautierT sure it will work if you remove this part of the code, but we want to keep that part to prevent unexpected errors while generating the UI based on your Forest customization.
Can you help us by digging into your Forest customization code in order to find what is not accepted by the syntax inspector?
I only have this problem in my dev environment.
On production the code is compiled by babel.
I start my dev server like this : DEBUG=app:* DEBUG_DEPTH=15 nodemon ./node_modules/.bin/babel-node src/index.js
Here is the first lines of src/forest/index.js
'use strict'
import Liana from 'forest-express-mongoose';
import Events from './../../models/events'
import last from 'lodash/last'
import get from 'lodash/get'
import { getSignedUrlAsync } from '../files'
const Debug = require('debug')
const debug = Debug(('app:config:functions:forest'))
debug.log = console.log.bind(console)
Liana.collection('files', {
fields: [{
field: 'Signed Url',
type: 'String',
get: async function (object) {
return await getSignedUrlAsync(object.path)
}
}]
})
What do you need ?
Just to check what is the origin of the issue.
But I found it by my-self. If you comment out your imports
your server should start without error. So the import
syntax does not seem to be accepted by the syntax validator.
I'll search why.
@GautierT you can upgrade to the latest liana version (forest-express-mongoose@1.4.9), it should be fixed now.
Awesome ! Thanks for this very quick fix @arnaudbesnier .
Hi, when i try to config forest like that :
i have this error :
Seems that ES6 is not supported ?