Git Product home page Git Product logo

Comments (12)

arnaudbesnier avatar arnaudbesnier commented on June 16, 2024 1

@GautierT sorry for the misunderstanding on my side :(
It will be fixed this week for sure.

from forest-express-mongoose.

arnaudbesnier avatar arnaudbesnier commented on June 16, 2024 1

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.

arnaudbesnier avatar arnaudbesnier commented on June 16, 2024 1

@GautierT you can upgrade to the latest liana version ([email protected]), it should be fixed now.

from forest-express-mongoose.

arnaudbesnier avatar arnaudbesnier commented on June 16, 2024

Hi @GautierT, you're right!
This is something we have to improve, but I can't give you any ETA.

from forest-express-mongoose.

GautierT avatar GautierT commented on June 16, 2024

from forest-express-mongoose.

arnaudbesnier avatar arnaudbesnier commented on June 16, 2024

@GautierT,

The fix is now available on the latest liana version (1.4.3).

🌲🌲🌲

from forest-express-mongoose.

GautierT avatar GautierT commented on June 16, 2024

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.

arnaudbesnier avatar arnaudbesnier commented on June 16, 2024

What happens if you set a semi-colon at the end of the import line?

from forest-express-mongoose.

GautierT avatar GautierT commented on June 16, 2024

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.

arnaudbesnier avatar arnaudbesnier commented on June 16, 2024

@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.

GautierT avatar GautierT commented on June 16, 2024

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.

GautierT avatar GautierT commented on June 16, 2024

Awesome ! Thanks for this very quick fix @arnaudbesnier .

from forest-express-mongoose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.