Comments (12)
@GautierT sorry for the misunderstanding on my side :(
It will be fixed this week for sure.
from forest-express-mongoose.
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.
from forest-express-mongoose.
@GautierT you can upgrade to the latest liana version ([email protected]), it should be fixed now.
from forest-express-mongoose.
Hi @GautierT, you're right!
This is something we have to improve, but I can't give you any ETA.
from forest-express-mongoose.
from forest-express-mongoose.
The fix is now available on the latest liana version (1.4.3).
π²π²π²
from forest-express-mongoose.
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'
from forest-express-mongoose.
What happens if you set a semi-colon at the end of the import line?
from forest-express-mongoose.
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);
from forest-express-mongoose.
@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?
from forest-express-mongoose.
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 ?
from forest-express-mongoose.
Awesome ! Thanks for this very quick fix @arnaudbesnier .
from forest-express-mongoose.
Related Issues (20)
- TypeError: Class constructor ObjectId cannot be invoked without 'new' HOT 4
- export ResourceSerializer in type definition
- Forest Admin UI incorrectly display nested field HOT 2
- Smart Ations fields hooks endpoint cannot authenticate HOT 5
- Is this still supported? HOT 2
- Update document example from documentation doesn't seem to work HOT 1
- TypeError: RecordsRemover is not a constructor HOT 3
- Forest Admin Dashboard display mongoose mixed data type as [object,object]
- Forestadmin with Typescript project and MongoDB Atlas Free Plan
- Should be able to specify location of .forestadmin-schema.json HOT 1
- Non-Date types that store Date values cannot be rendered as a time-based Chart HOT 1
- Nested Enum types do not have values in the schema and crash the Create page in the UI HOT 7
- Smart relationship does not query the route HOT 4
- Smart actions - primaryKeys not generated in forestadmin schema HOT 2
- Smart Relationships are all empty in 7.8.4 and after
- Weird behaviour with certain model names HOT 1
- Having trouble connecting HOT 2
- Impossible to delete values in array field
- Can't user react components for smart views
- Vulnerability Notice on moment-timezone. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forest-express-mongoose.