Comments (14)
What error is thrown and can you also show how your provider looks
from core.
this is tace
error: uncaughtException: Unexpected identifier
{ date: 'Thu Oct 08 2015 10:32:32 GMT+0330 (IRST)',
process:
{ pid: 11489,
uid: 1000,
gid: 100,
cwd: '/home/amir/Desktop/test',
execPath: '/home/amir/.nvm/versions/io.js/v3.3.1/bin/iojs',
version: 'v3.3.1',
argv:
[ '/home/amir/.nvm/versions/io.js/v3.3.1/bin/iojs',
'/home/amir/Desktop/test/server.js' ],
memoryUsage: { rss: 32239616, heapTotal: 16486912, heapUsed: 8283336 } },
os: { loadavg: [ 0.8828125, 0.9150390625, 1.375 ], uptime: 1798 },
trace:
[ { column: 16,
file: 'vm.js',
function: 'exports.runInThisContext',
line: 53,
method: 'runInThisContext',
native: false },
{ column: 25,
file: 'module.js',
function: 'Module._compile',
line: 413,
method: '_compile',
native: false },
{ column: 10,
file: 'module.js',
function: 'Object.Module._extensions..js',
line: 448,
method: 'Module._extensions..js',
native: false },
{ column: 32,
file: 'module.js',
function: 'Module.load',
line: 355,
method: 'load',
native: false },
{ column: 12,
file: 'module.js',
function: 'Function.Module._load',
line: 310,
method: 'Module._load',
native: false },
{ column: 17,
file: 'module.js',
function: 'Module.require',
line: 365,
method: 'require',
native: false },
{ column: 17,
file: 'module.js',
function: 'require',
line: 384,
method: null,
native: false },
{ column: 13,
file: '/home/amir/Desktop/test/bootstrap/http.js',
function: '',
line: 14,
method: null,
native: false },
{ column: 26,
file: 'module.js',
function: 'Module._compile',
line: 430,
method: '_compile',
native: false },
{ column: 10,
file: 'module.js',
function: 'Object.Module._extensions..js',
line: 448,
method: 'Module._extensions..js',
native: false } ],
stack:
[ 'SyntaxError: Unexpected identifier',
' at exports.runInThisContext (vm.js:53:16)',
' at Module._compile (module.js:413:25)',
' at Object.Module._extensions..js (module.js:448:10)',
' at Module.load (module.js:355:32)',
' at Function.Module._load (module.js:310:12)',
' at Module.require (module.js:365:17)',
' at require (module.js:384:17)',
' at Object.<anonymous> (/home/amir/Desktop/test/bootstrap/http.js:14:13)',
' at Module._compile (module.js:430:26)',
' at Object.Module._extensions..js (module.js:448:10)' ] }
from core.
sorry ...
/provider/Challenge/provier.js
'use strict'
const ServiceProvider = require('adonis-fold').ServiceProvider
const Challenge = require('./Challenge')
class ChallengeProvider extends ServiceProvider {
* register() {
this.app.bind('Challenge/Challenge', function() {
return new Challenge()
})
}
}
from core.
There is some syntax error in your Challenge.js
file.
Here's is the problem
The reason you are not able to see the exact error is , v8 removes the filename from error stack and node is not able to get it back. Check out this thread
nodejs/node-v0.x-archive#3452
from core.
my challenge.js
'use strict'
class Challenge {
* getTime() {
return new Date().getTime;
}
}
module.exports = Challenge
i don't think the related to my class
from core.
There is some syntax error as the stack trace states. I created a quick repo with your service provider and it works fine.
Try cloning this https://github.com/thetutlage/adonis-issue-7
Not getting the filename for error is inconvenience but that is by v8 itself.
from core.
wwwwow thx
but also data that my function return in challenge class is empty array in homecontroller ...
from core.
Any chance of sharing your code repo , or a copy of your code ?
from core.
no also
https://github.com/thetutlage/adonis-issue-7
has this error ...
my homecontroller
'use strict'
const ch = use('Challenge/Challenge')
class HomeController {
* index(request, response) {
return ch.getTime()
}
}
module.exports = HomeController
from core.
https://github.com/thetutlage/adonis-issue-7 works fine for me and as it is a syntax error it will have nothing to do with version of node or npm
from core.
Also getTime
is generator function , so you have to prepend it with yield
from core.
thx ... every thing work fine ....
from core.
👍
from core.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from core.
Related Issues (20)
- Adonis js doesnt look filename with extension, build ERROR HOT 1
- Functionnal testing with auth HOT 7
- Incomplete project structure HOT 1
- Bullmq Worker not reusing configured active redis connection
- ENOSPC: System limit for number of file watchers reached, from `yarn dev` HOT 6
- Kit doesn't taken in count by creating a new project with a project name HOT 3
- Adonis mail + node ace commands don't work HOT 3
- Support for yarn@berry HOT 12
- Hashing HOT 5
- Feature - Vine and request HOT 5
- Broken Installation of the Slim Starter Kit. HOT 6
- Bun support for ace add
- Install version 5 of Adonis in node 18 e 20 HOT 1
- Startup project error - mysql version
- The requested module 'node:module' does not provide an export named 'register' Error HOT 1
- Error: "Top-level await is not available in the configured target environment" HOT 1
- Undefined `@adonisjs/lucid/services/db` in commands HOT 2
- JAPA does not make correct API calls, unpredictably HOT 4
- Build Error HOT 5
- Env with special characters HOT 2
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 core.